{ "info": { "author": "Bruno Rocha", "author_email": "rochacbruno@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: ISC License (ISCL)", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "===============================\nBlinker Herald\n===============================\n\n.. image:: https://img.shields.io/pypi/v/blinker_herald.svg\n :target: https://pypi.python.org/pypi/blinker_herald\n\n.. image:: https://img.shields.io/travis/rochacbruno/blinker_herald.svg\n :target: https://travis-ci.org/SatelliteQE/blinker_herald\n\n.. image:: https://readthedocs.org/projects/blinker_herald/badge/?version=latest\n :target: https://readthedocs.org/projects/blinker_herald/?badge=latest\n :alt: Documentation Status\n\n.. image:: https://coveralls.io/repos/github/SatelliteQE/blinker_herald/badge.svg?branch=master\n :target: https://coveralls.io/github/SatelliteQE/blinker_herald?branch=master\n :alt: Coverage\n\n.. image:: docs/The_Herald.jpg\n :scale: 50 %\n\nThe Blinker Herald includes helpers to easily emit signals using the excelent\n`blinker`_ library.\n\nDecorate a function or method with :code:`@blinker_herald.emit()`\nand **pre** and **post** signals will be automatically emitted to\nall connected handlers.\n\n* Free software: ISC license\n* Documentation: https://blinker_herald.readthedocs.org.\n\nFeatures\n--------\n\n* All the features provided by `blinker`_\n* `+` an easy decorator :code:`@emit()` to magically emit signals when your functions are called and before it returns a result.\n* A :code:`signals` namespace proxy to discover the signals in your project\n* Customizable for your needs\n\n\nUsage\n-----\nLet's say you have a class and wants to emit a signal for a specific method::\n\n from blinker_herald import emit\n\n class SomeClass(object):\n\n @emit()\n def do_something(self, arg1):\n # here is were magically the 'pre' signal will be sent\n return 'something done'\n # here is were magically the 'post' signal will be sent\n\n\nusing :code:`@emit` decorator makes blinker_herald to emit a signal for that method\nand now you can connect handlers to capture that signals\n\nYou can capture **pre** signal to manipulate the object::\n\n SomeClass.do_something.pre.connect\n def handle_pre(sender, signal_emitter, **kwargs):\n signal_emitter.foo = 'bar'\n signal_emitter.do_another_thing()\n\nAnd you can also capture the **post** signal to log the results::\n\n SomeClass.do_something.post.connect\n def handle_post(sender, signal_emitter, result, **kwargs):\n logger.info(\"The method {0} returned {1}\".format(sender, result))\n\n\nYou can also use the namespace proxy :code:`blinker_herald.signals` to connect\nhandlers to signals, the signal name is the prefix **pre** or **post**\nfollowed by **_** and the method name::\n\n from blinker_herald import signals\n\n @signals.pre_do_something.connect\n def handle_pre(sender, signal_emitter, **kwargs):\n ...\n\n\nIf you have a lot of subclasses emitting signals with the same name and you\nneed to capture only specific signals, you can specify that you want to listen\nto only one type of sender::\n\n from blinker_herald import emit, signals, SENDER_CLASS\n class BaseModel(object):\n ...\n @emit(sender=SENDER_CLASS)\n def create(self, **kwargs):\n new_instance = my_project.new(self, **kwargs)\n return new_instance\n\n class One(BaseModel):\n pass\n\n class Two(BaseModel):\n pass\n\n.. note::\n By default the sender is always the instance but you can use :code:`SENDER_CLASS`\n to force the sender to be the **class** another options are **SENDER_CLASS_NAME**,\n **SENDER_MODULE**, **SENDER_NAME** and you can also pass a string, an object\n or a lambda receiving the **sender** instance e.g: :code:`@emit(sender=lambda self: self.get_sender())`\n\nUsing :code:`SENDER_CLASS` you can now connect to specific signal::\n\n from blinker_herald import signals\n\n @signals.post_create.connect_via(One)\n def handle_post_only_for_one(sender, signal_emitter, result, **kwargs):\n # sender is the class One (cls)\n # signal the instance of the class One (self)\n # result is the return of the method create\n\nThe above will handle the :code:`create` method signal for the class **One** but not for the class **Two**\n\n\nYou can also be more specific about the signal you want to connect using the\n**__** double underscore to provide method name::\n\n from blinker_herald import signals\n\n @signals.module_name__ClassName__post_method_name.connect\n def handle_post(sender, signal_emitter, result, **kwargs):\n ...\n\nThe above will connect to the **post** signal emitted by :code:`module_name.ClassName.method_name`\n\n.. note::\n You don't have to use the pattern above if your project do not have a lot of\n method name collisions, using only the method name will be just fine for most cases.\n\n\n\nCredits\n-------\n\nThis software was first created by SatelliteQE team to provide signals to\nRobottelo and Nailgun\n\n.. _blinker: http://pypi.python.org/pypi/blinker\n\n\n=======\nHistory\n=======\n\n0.1.0 (2016-05-28)\n------------------\n\n* First release on PyPI.", "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/SatelliteQE/blinker_herald", "keywords": "blinker_herald", "license": "ISCL", "maintainer": null, "maintainer_email": null, "name": "blinker_herald", "package_url": "https://pypi.org/project/blinker_herald/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/blinker_herald/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/SatelliteQE/blinker_herald" }, "release_url": "https://pypi.org/project/blinker_herald/0.2.0/", "requires_dist": null, "requires_python": null, "summary": "The Blinker Herald includes helpers to easily emit signals using Blinker. Decorate a function or method with @blinker_herald.emit() and pre and post signals will automatically be emitted to connected handlers.", "version": "0.2.0" }, "last_serial": 2140689, "releases": { "0.0.0": [], "0.1.0": [ { "comment_text": "", "digests": { "md5": "29d85d2abb1d5e022c1ec4d9e688baa0", "sha256": "3aae5c921ce67ef403ca4b57500b5e2070b56e80e2b1aef153970d7ed18493f2" }, "downloads": -1, "filename": "blinker_herald-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "29d85d2abb1d5e022c1ec4d9e688baa0", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 6584, "upload_time": "2016-05-28T19:58:50", "url": "https://files.pythonhosted.org/packages/39/41/a2d0883331a05eac2843f980465e0a49ea99057b0e1b107c15fa09269dba/blinker_herald-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "96453d514c80e5418a7cae6ea73f90c4", "sha256": "4247bd92904bfb10251dcc360a2bbb34477f4e92748588d74880483c231e2967" }, "downloads": -1, "filename": "blinker_herald-0.1.0.tar.gz", "has_sig": false, "md5_digest": "96453d514c80e5418a7cae6ea73f90c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 134275, "upload_time": "2016-05-28T19:58:45", "url": "https://files.pythonhosted.org/packages/3c/2e/540a1669ebf5eaf3e781073dfc1ed86a8dafed6628aeb325f3b93f55896e/blinker_herald-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "11265eb654375e7a76f8ef322b22e757", "sha256": "2558c404a1ea0f62b99a167d0d8794bbc45fcd3b1e8d8bdfcab1dd1d2b1809f9" }, "downloads": -1, "filename": "blinker_herald-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "11265eb654375e7a76f8ef322b22e757", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 8310, "upload_time": "2016-05-30T12:31:54", "url": "https://files.pythonhosted.org/packages/c5/01/ec44660f2a35b3e280e2d8334fff6396657feaa2e59f9675604be586bf96/blinker_herald-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bbe974b9fe5b5a381dcbb1ae63fc35fd", "sha256": "b1fd320aa594a5f0cd4cd2e07db97cdbbea00197fdcd38161c873864315351cd" }, "downloads": -1, "filename": "blinker_herald-0.2.0.tar.gz", "has_sig": false, "md5_digest": "bbe974b9fe5b5a381dcbb1ae63fc35fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 42090, "upload_time": "2016-05-30T12:31:49", "url": "https://files.pythonhosted.org/packages/98/fe/c3ef82a7d78ddcecff0cbae06433f0c0fd164910d5308af7594370ebfd11/blinker_herald-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "11265eb654375e7a76f8ef322b22e757", "sha256": "2558c404a1ea0f62b99a167d0d8794bbc45fcd3b1e8d8bdfcab1dd1d2b1809f9" }, "downloads": -1, "filename": "blinker_herald-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "11265eb654375e7a76f8ef322b22e757", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 8310, "upload_time": "2016-05-30T12:31:54", "url": "https://files.pythonhosted.org/packages/c5/01/ec44660f2a35b3e280e2d8334fff6396657feaa2e59f9675604be586bf96/blinker_herald-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bbe974b9fe5b5a381dcbb1ae63fc35fd", "sha256": "b1fd320aa594a5f0cd4cd2e07db97cdbbea00197fdcd38161c873864315351cd" }, "downloads": -1, "filename": "blinker_herald-0.2.0.tar.gz", "has_sig": false, "md5_digest": "bbe974b9fe5b5a381dcbb1ae63fc35fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 42090, "upload_time": "2016-05-30T12:31:49", "url": "https://files.pythonhosted.org/packages/98/fe/c3ef82a7d78ddcecff0cbae06433f0c0fd164910d5308af7594370ebfd11/blinker_herald-0.2.0.tar.gz" } ] }