{ "info": { "author": "Luke Plant", "author_email": "L.Plant.98@cantab.net", "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.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4" ], "description": "===============================\r\nspousefriendly\r\n===============================\r\n\r\n.. image:: https://img.shields.io/pypi/v/spousefriendly.svg\r\n :target: https://pypi.python.org/pypi/spousefriendly\r\n\r\n\r\nBe nice to your spouse (or other person who needs to run your scripts) - give your command line scripts some GUI feedback when needed.\r\n\r\n* Free software: ISC license\r\n* Documentation: https://bitbucket.org/spookylukey/spousefriendly\r\n\r\nMotivation\r\n----------\r\n\r\nDevelopers usually like to run scripts from a terminal. In addition,\r\nfor these kind of Python scripts, if something goes wrong, the easiest thing to\r\ndo is let it fail 'ungracefully', at which point you get a helpful stacktrace on\r\nthe screen. And if it goes well, it should just exit without printing anything.\r\n\r\nFor your spouse or friend who just wants to double click an icon, both these\r\nbehaviours will be very confusing. They normally want confirmation that it\r\nworked and is finished, and if it doesn't it should show some kind of nice error\r\nmessage.\r\n\r\nThis package provides some simple wrappers (normally context managers) so that\r\nyou can get the best of both worlds.\r\n\r\nBasic usage\r\n-----------\r\n\r\nTake a typical script::\r\n\r\n def main():\r\n # Stuff here\r\n\r\n\r\n if __name__ == '__main__':\r\n main()\r\n\r\n\r\nSimply wrap the call to main in a spousefriendly.friendly_success_and_failure with block::\r\n\r\n\r\n import spousefriendly\r\n\r\n if __name__ == '__main__':\r\n with spousefriendly.friendly_success_and_failure():\r\n main()\r\n\r\n\r\nIf running from a terminal, there will be no change in behaviour. From a GUI,\r\nhowever (e.g. launched from a file manager), upon exit there will be a success\r\nmessage, or a failure message if appropriate.\r\n\r\n\r\nDetailed usage\r\n--------------\r\n\r\n``friendly_success_and_failure`` composes two context managers::\r\n\r\n spousefriendly.friendly_success(success_message='Optional success message')\r\n\r\n spousefriendly.friendly_failure(failure_message='Optional failure message')\r\n\r\nBoth ``success_message`` and ``failure_message`` can also be passed to\r\n``friendly_success_and_failure`` as keyword arguments. Sensible defaults are\r\nused if not supplied.\r\n\r\n\r\nLimitations\r\n-----------\r\n\r\nObviously, the context managers can't protect against anything that happens\r\noutside their scope (e.g. import errors etc.).\r\n\r\n\r\nTODO\r\n----\r\n\r\nWindows support! This is the most obvious one. Since I don't use Windows, I'm\r\nnot in a position to test this. I've put some rudimentary things in, but it\r\nprobably doesn't work.\r\n\r\n\r\n\r\n\r\nHistory\r\n-------\r\n\r\n0.1.0 (2015-01-11)\r\n---------------------\r\n\r\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://bitbucket.com/spookylukey/spousefriendly", "keywords": "spousefriendly", "license": "ISCL", "maintainer": "", "maintainer_email": "", "name": "spousefriendly", "package_url": "https://pypi.org/project/spousefriendly/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/spousefriendly/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://bitbucket.com/spookylukey/spousefriendly" }, "release_url": "https://pypi.org/project/spousefriendly/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Be nice to your spouse - give your command line scripts some GUI feedback when needed.", "version": "0.1.0" }, "last_serial": 1723335, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "0c65ff6315b683f2984c92f249490227", "sha256": "1309dfa01a38d1a07a80ebc541ba2d4131b5639c9811ad818026def85b290076" }, "downloads": -1, "filename": "spousefriendly-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0c65ff6315b683f2984c92f249490227", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 5842, "upload_time": "2015-09-15T10:47:44", "url": "https://files.pythonhosted.org/packages/3d/ed/249eeb6410588704dea46cb761047f9c86478cfd5ef2e7e617a22c4d62fe/spousefriendly-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dc528dff8699d55f6f44eecedbdd3210", "sha256": "0c6dd31b4b8613d092564bc06499d12588df69957a140a737f9fa8c958e6aa01" }, "downloads": -1, "filename": "spousefriendly-0.1.0.tar.gz", "has_sig": false, "md5_digest": "dc528dff8699d55f6f44eecedbdd3210", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6661, "upload_time": "2015-09-15T10:47:39", "url": "https://files.pythonhosted.org/packages/43/c9/5162102859e865c578748e3425b49bf6d5a37ed4a4431badd7f60be914e3/spousefriendly-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0c65ff6315b683f2984c92f249490227", "sha256": "1309dfa01a38d1a07a80ebc541ba2d4131b5639c9811ad818026def85b290076" }, "downloads": -1, "filename": "spousefriendly-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0c65ff6315b683f2984c92f249490227", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 5842, "upload_time": "2015-09-15T10:47:44", "url": "https://files.pythonhosted.org/packages/3d/ed/249eeb6410588704dea46cb761047f9c86478cfd5ef2e7e617a22c4d62fe/spousefriendly-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dc528dff8699d55f6f44eecedbdd3210", "sha256": "0c6dd31b4b8613d092564bc06499d12588df69957a140a737f9fa8c958e6aa01" }, "downloads": -1, "filename": "spousefriendly-0.1.0.tar.gz", "has_sig": false, "md5_digest": "dc528dff8699d55f6f44eecedbdd3210", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6661, "upload_time": "2015-09-15T10:47:39", "url": "https://files.pythonhosted.org/packages/43/c9/5162102859e865c578748e3425b49bf6d5a37ed4a4431badd7f60be914e3/spousefriendly-0.1.0.tar.gz" } ] }