{ "info": { "author": "Eduard Bopp", "author_email": "eduard.bopp@aepsil0n.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development" ], "description": "obsub\n=====\n\n|Build Status| |Coverage| |Version| |Downloads| |License|\n\nSmall python module that implements the observer pattern via a\ndecorator.\n\n\nDescription\n-----------\n\nThis is based on a `thread on stackoverflow\n`_\n(the example of C#-like events by Jason Orendorff), so I don't take any\ncredit for the idea. I merely made a fancy module with documentation and\ntests out of it, since I needed it in a bigger project. It is quite\nhandy and I've been using it in a couple of projects, which require some\nsort of event handling.\n\nThus it is `licensed as\nCC0 `__, so basically\ndo-whatever-you-want to the extent legally possible.\n\n\nInstallation\n------------\n\n*obsub* is available on PyPI, so you can simply install it using\n``pip install obsub`` or you do it manually using ``setup.py`` as with\nany python package.\n\n\nUsage\n-----\n\nThe ``event`` decorator from the ``obsub`` module is used as follows:\n\n.. code:: python\n\n from obsub import event\n\n # Define a class with an event\n class Subject(object):\n @event\n def on_stuff(self, arg):\n print('Stuff {} happens'.format(arg))\n\n # Now define an event handler, the observer\n def handler(subject, arg):\n print('Stuff {} is handled'.format(arg))\n\n # Wire everything up...\n sub = Subject()\n sub.on_stuff += handler\n\n # And try it!\n sub.on_stuff('foo')\n\nYou should now get both print messages from the event itself and the\nevent handler function, like so:\n\n::\n\n Stuff foo happens\n Stuff foo is handled\n\n\nContinuous integration\n----------------------\n\nFor the fun of it, `Travis CI `__\nis used for continuous integration. As long as everything is fine, the\nbutton below should be green and shiny!\n\n|Build Status|\n\nThe continuous integration ensures that our tests run on the following\nplatforms:\n\n- Python 2.6, 2.7\n- Python 3.2, 3.3\n- pypy\n\nIt might also work on Python 2.5, but is not automatically tested with this\nversion.\n\nWe also track the coverage of our tests with coveralls.io\n\n|Coverage|\n\nUse `coverage `__ to generate local\ncoverage reports like this:\n\n::\n\n coverage run setup.py nosetests\n\nNote: on some platforms (e.g. Ubuntu) the executable is called\n``python-coverage``.\n\n\nContribution and feedback\n-------------------------\n\n*obsub* is developed on `github `__.\n\nIf you have any questions about this software or encounter bugs, you're welcome\nto open a `new issue on github `__.\n\nIn case you do not want to use github for some reason, you can alternatively\nsend an email one of us:\n\n- `Eduard Bopp `__\n- `Andr\u00e9-Patrick Bubel `__\n- `Thomas Gl\u00e4\u00dfle `__\n\nFeel free to contribute patches as pull requests as you see fit. Try to be\nconsistent with PEP 8 guidelines as far as possible and test everything.\nOtherwise, your commit messages should start with a capitalized verb for\nconsistency. Unless your modification is completely trivial, also add a message\nbody to your commit.\n\n\n\nCredits\n-------\n\nThanks to Jason Orendorff on for the idea on stackoverflow. I also want\nto thank @coldfix and @Moredread for contributions and feedback.\n\n.. |Downloads| image:: https://pypip.in/d/obsub/badge.png\n :target: https://pypi.python.org/pypi/obsub/\n :alt: Downloads\n.. |Version| image:: https://pypip.in/v/obsub/badge.png\n :target: https://pypi.python.org/pypi/obsub/\n :alt: Latest Version\n.. |License| image:: https://pypip.in/license/obsub/badge.png\n :target: https://pypi.python.org/pypi/obsub/\n :alt: License\n.. |Build Status| image:: https://api.travis-ci.org/aepsil0n/obsub.png?branch=master\n :target: https://travis-ci.org/aepsil0n/obsub\n.. |Coverage| image:: https://coveralls.io/repos/aepsil0n/obsub/badge.png?branch=master\n :target: https://coveralls.io/r/aepsil0n/obsub\n\nChangelog\n---------\n\nv0.2\n~~~~\n\nFrom a user perspective the preservation of function signatures and a couple of\nbug fixes are probably most relevant. Python 2.5 is no longer tested by\ncontinuous integration, though we try to avoid unnecessary changes that might\nbreak backwards compatibility.\n\nIn addition, there are quite a number of changes that mostly concern\ndevelopers.\n\n- Function signatures are now preserved correctly by the event decorator. This\n is true only for python3. On python2 there is no support for default\n arguments, currently\n- Some fixes to memory handling and tests thereof. This includes a more generic\n handling of the garbage collection process within the test suite to make it\n pass on pypy, too.\n- Massive refactoring of test suite from one very long doctest to more focussed\n unit tests.\n- The documentation has been converted from Markdown to reStructuredText, since\n it is compatible with both PyPI and GitHub.\n- Various improvements and some streamlining of the documentation.\n- Fix package name in license.\n- Continuous integration now includes coveralls.io support.\n- Support for Python 2.5 is no longer tested using Travis CI, since they have\n dropped support for this version.\n\n\nv0.1.1\n~~~~~~\n\n- Add __all__ attribute to module\n- Fix a couple of documentation issues\n\n\nv0.1\n~~~~\n\n*Initial release*", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/aepsil0n/obsub", "keywords": null, "license": "Public Domain", "maintainer": null, "maintainer_email": null, "name": "obsub", "package_url": "https://pypi.org/project/obsub/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/obsub/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/aepsil0n/obsub" }, "release_url": "https://pypi.org/project/obsub/0.2/", "requires_dist": null, "requires_python": null, "summary": "Implementation of the observer pattern via a decorator", "version": "0.2" }, "last_serial": 1008471, "releases": { "0.1.0": [], "0.1.1": [ { "comment_text": "", "digests": { "md5": "3e5b27e0c2a5422216e878e6840a0f0a", "sha256": "2a5d1fdc4f80b3955f8e88d409d2d274a019795c4103455680aadbc463b70845" }, "downloads": -1, "filename": "obsub-0.1.1.tar.gz", "has_sig": false, "md5_digest": "3e5b27e0c2a5422216e878e6840a0f0a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7347, "upload_time": "2013-09-09T11:10:58", "url": "https://files.pythonhosted.org/packages/21/ef/83c04d52bec83d98325c4bb434ba77cd13c23be06bfe85bdb6af55505b46/obsub-0.1.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "1035d87769733b7ac18a82b626aefbe9", "sha256": "1636e8a0145cc7cd7384f879f8e40e84e43dcd5c73ffca7b12ef3d6d27866461" }, "downloads": -1, "filename": "obsub-0.2.tar.gz", "has_sig": false, "md5_digest": "1035d87769733b7ac18a82b626aefbe9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11337, "upload_time": "2014-02-22T11:51:01", "url": "https://files.pythonhosted.org/packages/1b/82/5339a29db40d4457781cbe3ed8358794fca76476740d5951d1320ef3d448/obsub-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1035d87769733b7ac18a82b626aefbe9", "sha256": "1636e8a0145cc7cd7384f879f8e40e84e43dcd5c73ffca7b12ef3d6d27866461" }, "downloads": -1, "filename": "obsub-0.2.tar.gz", "has_sig": false, "md5_digest": "1035d87769733b7ac18a82b626aefbe9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11337, "upload_time": "2014-02-22T11:51:01", "url": "https://files.pythonhosted.org/packages/1b/82/5339a29db40d4457781cbe3ed8358794fca76476740d5951d1320ef3d448/obsub-0.2.tar.gz" } ] }