{ "info": { "author": "Gil Forcada", "author_email": "gil.gnome@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Flake8", "Framework :: Plone", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Topic :: Software Development" ], "description": ".. -*- coding: utf-8 -*-\n\n.. image:: https://travis-ci.org/gforcada/flake8-plone-hasattr.svg?branch=master\n :target: https://travis-ci.org/gforcada/flake8-plone-hasattr\n\n.. image:: https://coveralls.io/repos/gforcada/flake8-plone-hasattr/badge.svg?branch=master&service=github\n :target: https://coveralls.io/github/gforcada/flake8-plone-hasattr?branch=master\n\nFlake8 Plone hasattr plugin\n===========================\nPython standard ``hasattr`` is considered harmful (within Plone projects).\n\nThe (hidden) problem with ``hasattr`` is that it swallows exceptions,\nwhich in your normal business logic you really don't want to.\n\nSpecially in Plone context that could mean swallowing a database error,\nor a permission exception, etc.\n\nTake, for instance, the following code:\n\n.. code-block:: python\n\n >>> class Foo(object):\n ... @property\n ... def my_attr(self):\n ... raise ValueError('nope, nope, nope')\n ...\n >>> bar = Foo()\n >>> bar.my_attr\n Traceback (most recent call last):\n File \"\", line 1, in \n File \"\", line 4, in my_attr\n ValueError: nope, nope, nope\n >>> hasattr(Foo, 'my_attr')\n True\n >>> hasattr(bar, 'my_attr')\n False\n >>> getattr(bar, 'my_attr', None)\n Traceback (most recent call last):\n File \"\", line 1, in \n File \"\", line 4, in my_attr\n ValueError: nope, nope, nope\n\nThis plugin is based on a python checker that was in `plone.recipe.codeanalysis`_.\n\nInstall\n-------\nInstall with pip:\n\n.. code-block:: console\n\n $ pip install flake8-plone-hasattr\n\nRequirements\n------------\n- Python 2.7, 3.3, 3.4\n- flake8\n\nLicense\n-------\nGPL 2.0\n\n.. _`plone.recipe.codeanalysis`: https://pypi.python.org/pypi/plone.recipe.codeanalysis\n\n.. -*- coding: utf-8 -*-\n\nChangelog\n=========\n\n0.2.post0 (2017-05-31)\n----------------------\n- Release universal wheels\n [gforcada]\n\n0.2 (2017-05-31)\n----------------\n- Added support for sublimetext (stdin/filename handling)\n [iham]\n\n0.1 (2015-09-15)\n----------------\n- Initial release\n [gforcada]\n\n- Create the flake8 plugin per se.\n [gforcada]", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/gforcada/flake8-plone-hasattr", "keywords": "pep8 flake8 plone", "license": "GPL version 2", "maintainer": "", "maintainer_email": "", "name": "flake8-plone-hasattr", "package_url": "https://pypi.org/project/flake8-plone-hasattr/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/flake8-plone-hasattr/", "project_urls": { "Homepage": "https://github.com/gforcada/flake8-plone-hasattr" }, "release_url": "https://pypi.org/project/flake8-plone-hasattr/0.2.post0/", "requires_dist": [ "flake8" ], "requires_python": "", "summary": "Checks for hasattr, which is considered harmful in Plone projects.", "version": "0.2.post0" }, "last_serial": 2914845, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "eb74471647aa6db95cc7b1ee8bb662ac", "sha256": "45ff3b73b1cd07179ce73bfe2ddb5891d38250fd3845639ece4132254c90f05a" }, "downloads": -1, "filename": "flake8-plone-hasattr-0.1.tar.gz", "has_sig": false, "md5_digest": "eb74471647aa6db95cc7b1ee8bb662ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10342, "upload_time": "2015-09-15T06:13:37", "url": "https://files.pythonhosted.org/packages/c4/40/b972419510ae253d89140658fb7423c2ba57a7abad2238c22938d2a721f2/flake8-plone-hasattr-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "bd9d893b9d57307d2c87b23db4ad29e8", "sha256": "ba177b39fca22aab3593bc159c7e32529be332e79bd53e59ff53598b5d7bd82a" }, "downloads": -1, "filename": "flake8-plone-hasattr-0.2.tar.gz", "has_sig": false, "md5_digest": "bd9d893b9d57307d2c87b23db4ad29e8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11139, "upload_time": "2017-05-31T21:13:56", "url": "https://files.pythonhosted.org/packages/ed/04/b7c28267038def3bb5054f410e5be55e0c2e735ac4429ec8f42bcf17592c/flake8-plone-hasattr-0.2.tar.gz" } ], "0.2.post0": [ { "comment_text": "", "digests": { "md5": "aa477eeef0a42d676ea4b59b7925b744", "sha256": "cfabd900e3ac68c47f46e4fa82e5db23463ceb954fc91e2a3b209f3c810e0c3f" }, "downloads": -1, "filename": "flake8_plone_hasattr-0.2.post0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "aa477eeef0a42d676ea4b59b7925b744", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5083, "upload_time": "2017-05-31T21:17:18", "url": "https://files.pythonhosted.org/packages/3c/62/74fad8a02d5e340b22505c19f3910e60a65f41df3a424a65e1cf3ec9c81e/flake8_plone_hasattr-0.2.post0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f5fa93cef4630f3eec3af1bbab90d138", "sha256": "f72ef91a47de847f80749a3668aad89fb23f0e6dcf93a1100b0e909b9e378ec6" }, "downloads": -1, "filename": "flake8-plone-hasattr-0.2.post0.tar.gz", "has_sig": false, "md5_digest": "f5fa93cef4630f3eec3af1bbab90d138", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11291, "upload_time": "2017-05-31T21:17:20", "url": "https://files.pythonhosted.org/packages/db/d4/63e659daf3b6d08854b7a6cd1d90743fe610cf33c4302ab0484d88ce2c49/flake8-plone-hasattr-0.2.post0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "aa477eeef0a42d676ea4b59b7925b744", "sha256": "cfabd900e3ac68c47f46e4fa82e5db23463ceb954fc91e2a3b209f3c810e0c3f" }, "downloads": -1, "filename": "flake8_plone_hasattr-0.2.post0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "aa477eeef0a42d676ea4b59b7925b744", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5083, "upload_time": "2017-05-31T21:17:18", "url": "https://files.pythonhosted.org/packages/3c/62/74fad8a02d5e340b22505c19f3910e60a65f41df3a424a65e1cf3ec9c81e/flake8_plone_hasattr-0.2.post0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f5fa93cef4630f3eec3af1bbab90d138", "sha256": "f72ef91a47de847f80749a3668aad89fb23f0e6dcf93a1100b0e909b9e378ec6" }, "downloads": -1, "filename": "flake8-plone-hasattr-0.2.post0.tar.gz", "has_sig": false, "md5_digest": "f5fa93cef4630f3eec3af1bbab90d138", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11291, "upload_time": "2017-05-31T21:17:20", "url": "https://files.pythonhosted.org/packages/db/d4/63e659daf3b6d08854b7a6cd1d90743fe610cf33c4302ab0484d88ce2c49/flake8-plone-hasattr-0.2.post0.tar.gz" } ] }