{ "info": { "author": "sthysel", "author_email": "sthysel@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Utilities" ], "description": "\n======================================\n\n\n.. image:: https://readthedocs.org/projects/attentive/badge/?version=latest\n :target: http://attentive.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n\n.. image:: https://github.com/sthysel/attentive/blob/master/docs/attentive.jpg?raw=true\n\n\n.. code:: python \n\n\n from attentive import StoppableThread, quit\n from random import randint\n\n\n class Man(StoppableThread):\n def __init__(self, name):\n StoppableThread.__init__(self)\n self.name = name\n\n def run(self):\n print('{} has quickened'.format(self.name))\n while not self.stopped:\n self.sleep(randint(1, 10))\n print('{} throws a {}'.format(self.name, randint(1, 6)))\n\n print('{} expires'.format(self.name))\n\n\n with Man('Trump'), Man('Wang'), Man('Erdo\u011fan'):\n while not quit.is_set():\n quit.wait(1)\n\n\n\nExample Run\n***********\n\n.. code:: bash\n\n\n \ud83d\udebcTrump has quickened\n \ud83d\udebcWang has quickened\n \ud83d\udebcErdo\u011fan has quickened\n Wang throws a \u2623 \n Trump throws a \u2622 \n Erdo\u011fan throws a \u2623 \n Wang throws a \u2623 \n Wang throws a \u2623 \n Erdo\u011fan throws a \ud83c\udf6d\n Erdo\u011fan throws a \u2623 \n Trump throws a \u2623 \n ^CErdo\u011fan throws a \ud83c\udf7c\n \u2620 Erdo\u011fan expires\n Wang throws a \u2623 \n \u2620 Wang expires\n Trump throws a \ud83c\udf7c\n \u2620 Trump expires\n\n\n\nUse ``attentive`` if you need to wire up a some worker threads that needs to cleanly \nshut themselves down on a SIG_INT or SIG_TERM. \n\n``StoppableThread`` is a context managed thread that lives on while in context. Once it exists \ncontext it sets its internal stopped flag that are periodically checked for state. This signals \nthread state allowing the thread to cleanly exit.\n\nExternal state is controlled by a signal event, exiting the main context loop.\n\nInternally use the StoppableThread.sleep() method that is interrupted when stop()ed during\nsleep.\n\nInstall\n=======\n\nInstall from pypi\n\n.. code::\n\n $ pip install attentive\n\nInstall from source\n\n.. code::\n\n $ pip install .\n\n\n\nVersioning\n==========\n\nCurrent version is 0.1.5\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sthysel/attentive", "keywords": "", "license": "GPLv2", "maintainer": "", "maintainer_email": "", "name": "attentive", "package_url": "https://pypi.org/project/attentive/", "platform": "", "project_url": "https://pypi.org/project/attentive/", "project_urls": { "Homepage": "https://github.com/sthysel/attentive" }, "release_url": "https://pypi.org/project/attentive/0.1.5/", "requires_dist": null, "requires_python": "", "summary": "Stoppable thread with common stop signalling", "version": "0.1.5" }, "last_serial": 3158294, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "c3b683d7cf6672af613f106543b2f341", "sha256": "5bb7186fa89c95eb338cf9a0b60a573699d47852a8ea9176673d3c2f7548e0de" }, "downloads": -1, "filename": "attentive-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c3b683d7cf6672af613f106543b2f341", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4880, "upload_time": "2017-05-14T14:27:57", "url": "https://files.pythonhosted.org/packages/c4/61/c49c74d2cfab50900373151de5916e06a12cabdcd0036839eac43ab07bc1/attentive-0.1.1-py2.py3-none-any.whl" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "41380bc4e142d6ffcdf3de4af46413ad", "sha256": "5975a789ae2de730aca7f33af23ff9472949fd01196d4d81f44181a97265fa0b" }, "downloads": -1, "filename": "attentive-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "41380bc4e142d6ffcdf3de4af46413ad", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4887, "upload_time": "2017-05-14T14:37:22", "url": "https://files.pythonhosted.org/packages/af/13/944359f83149a9802025783845158a85990752d1a3c9d408f0026e38f696/attentive-0.1.2-py2.py3-none-any.whl" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "2e0a51c56082587407d4af143e8920bb", "sha256": "64285ed056f6a23ddf59ecf3f00632be5c1773fe1f8d5566c5dacbbeccdc50d5" }, "downloads": -1, "filename": "attentive-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2e0a51c56082587407d4af143e8920bb", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5139, "upload_time": "2017-05-18T04:32:56", "url": "https://files.pythonhosted.org/packages/a2/61/19f443622e74301ed45d820d00852617ab3313d4b57feb1a7b799580c953/attentive-0.1.3-py2.py3-none-any.whl" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "f12aad3778ec07714507d7331adb2168", "sha256": "865abc060c1078387a0f613a2f3df4d0e5b5728c07a17cf325981e5d78964af0" }, "downloads": -1, "filename": "attentive-0.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f12aad3778ec07714507d7331adb2168", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5130, "upload_time": "2017-05-20T15:56:51", "url": "https://files.pythonhosted.org/packages/2c/b9/9a3b9e462c82e50a04f1bc4dd2e1c7312c0240ac37ec65c3506b48a681f3/attentive-0.1.4-py2.py3-none-any.whl" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "e95e00ef2d03dd7aa490120cb0b56ad5", "sha256": "debe72dfd915d569ec5aaa2bd0699daa91b09730de49030c0460768a7f4381bf" }, "downloads": -1, "filename": "attentive-0.1.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e95e00ef2d03dd7aa490120cb0b56ad5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5138, "upload_time": "2017-09-08T05:18:54", "url": "https://files.pythonhosted.org/packages/b1/5f/0422494cf88c5255d059897f674a6897f42b80b35a2f194852dfebcd06bd/attentive-0.1.5-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e95e00ef2d03dd7aa490120cb0b56ad5", "sha256": "debe72dfd915d569ec5aaa2bd0699daa91b09730de49030c0460768a7f4381bf" }, "downloads": -1, "filename": "attentive-0.1.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e95e00ef2d03dd7aa490120cb0b56ad5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5138, "upload_time": "2017-09-08T05:18:54", "url": "https://files.pythonhosted.org/packages/b1/5f/0422494cf88c5255d059897f674a6897f42b80b35a2f194852dfebcd06bd/attentive-0.1.5-py2.py3-none-any.whl" } ] }