{ "info": { "author": "Stefan H. Holek", "author_email": "stefan@epy.co.at", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3" ], "description": "===========\nconditional\n===========\n-------------------------------------------------------------------\nConditionally enter a context manager\n-------------------------------------------------------------------\n\nPackage Contents\n================\n\nconditional(condition, contextmanager)\n Enter contextmanager only if condition is true.\n\nOverview\n========\n\nThe *conditional* context manager comes handy when you always want to\nexecute a with-block but only conditionally want to apply its context\nmanager.\n\nIf you find yourself writing code like this::\n\n if CONDITION:\n with CONTEXTMANAGER():\n BODY()\n else:\n BODY()\n\nConsider replacing it with::\n\n with conditional(CONDITION, CONTEXTMANAGER()):\n BODY()\n\nExamples\n========\n\nSay we want to ignore signals when a pager application is in the\nforeground, but not otherwise::\n\n from conditional import conditional\n\n with conditional(has_pager(cmd), ignoresignals()):\n os.system(cmd)\n\nDocumentation\n=============\n\nFor further details please refer to the `API Documentation`_.\n\n.. _`API Documentation`: https://conditional.readthedocs.io/en/stable/\n\n\nChangelog\n=========\n\n1.3 - 2019-01-28\n----------------\n\n- Add MANIFEST.in.\n [stefan]\n\n- Release as wheel.\n [stefan]\n\n1.2 - 2017-02-05\n----------------\n\n- Support Python 2.6-3.6 without 2to3.\n [stefan]\n\n- Add a LICENSE file.\n [stefan]\n\n1.1 - 2014-04-19\n----------------\n\n- Remove setuptools from install_requires because it isn't.\n [stefan]\n\n1.0 - 2012-05-16\n----------------\n\n- Initial release.\n [stefan]\n", "description_content_type": "", "docs_url": "https://pythonhosted.org/conditional/", "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/stefanholek/conditional", "keywords": "conditional context manager with", "license": "BSD-2-Clause", "maintainer": "", "maintainer_email": "", "name": "conditional", "package_url": "https://pypi.org/project/conditional/", "platform": "", "project_url": "https://pypi.org/project/conditional/", "project_urls": { "Homepage": "https://github.com/stefanholek/conditional" }, "release_url": "https://pypi.org/project/conditional/1.3/", "requires_dist": null, "requires_python": "", "summary": "Conditionally enter a context manager", "version": "1.3" }, "last_serial": 4751435, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "19d38091871accc7659067dcaf037312", "sha256": "5631a90f4a971d3f5c7494b241db53da6dc730c015aa96a7a72ae95f79ca2eb4" }, "downloads": -1, "filename": "conditional-1.0.zip", "has_sig": false, "md5_digest": "19d38091871accc7659067dcaf037312", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11965, "upload_time": "2012-05-16T11:41:04", "url": "https://files.pythonhosted.org/packages/33/40/169cffe29d1282ab97c3a20ca7add53b28a25014946afdc8e319f6770d74/conditional-1.0.zip" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "dd794ae0c0e4c527c9f43dd622f7ad8a", "sha256": "5553104de2b076ae6425a98c80e5c497de484f6041124519d6d1f7314bc8f79f" }, "downloads": -1, "filename": "conditional-1.1.zip", "has_sig": false, "md5_digest": "dd794ae0c0e4c527c9f43dd622f7ad8a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11986, "upload_time": "2014-04-19T19:58:13", "url": "https://files.pythonhosted.org/packages/d2/ad/f35e70d150b022bfe8272758d7d4b0963b5cb8fd5a26133d6f6adb3973b3/conditional-1.1.zip" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "b7c76feba49ff8ef5c7df43ca276a797", "sha256": "5de9ca0e574eeb26602bd05e14a1d43a356c7b26c6336c28e131b2f99f888aa8" }, "downloads": -1, "filename": "conditional-1.2.zip", "has_sig": false, "md5_digest": "b7c76feba49ff8ef5c7df43ca276a797", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13671, "upload_time": "2017-02-05T13:07:18", "url": "https://files.pythonhosted.org/packages/e4/2e/972122b7681af2d47d977e91cf33f64577042722a99db9806d174b24d35e/conditional-1.2.zip" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "2580018066bbed65d71c0c2c980dd4f7", "sha256": "61599e56358b635e17dc6b86a95de36825d49334ecab20e94c36609c8de92361" }, "downloads": -1, "filename": "conditional-1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2580018066bbed65d71c0c2c980dd4f7", "packagetype": "bdist_wheel", "python_version": "3.7", "requires_python": null, "size": 4393, "upload_time": "2019-01-28T18:54:43", "url": "https://files.pythonhosted.org/packages/9f/c6/edd61acdeb0d2985112408332f8253493d205bd454a6a6c475bad08ac5c2/conditional-1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4fd46cfa36277cb3a052e546db381421", "sha256": "4948fd9c923a9336e96dded17000fa0978122ee3b46ed146190d07c01953c56c" }, "downloads": -1, "filename": "conditional-1.3.zip", "has_sig": false, "md5_digest": "4fd46cfa36277cb3a052e546db381421", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8291, "upload_time": "2019-01-28T18:54:13", "url": "https://files.pythonhosted.org/packages/63/18/573ba05ce97549e1929b58e39e60789d1ea08de330fdd7dff7355be761ea/conditional-1.3.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2580018066bbed65d71c0c2c980dd4f7", "sha256": "61599e56358b635e17dc6b86a95de36825d49334ecab20e94c36609c8de92361" }, "downloads": -1, "filename": "conditional-1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2580018066bbed65d71c0c2c980dd4f7", "packagetype": "bdist_wheel", "python_version": "3.7", "requires_python": null, "size": 4393, "upload_time": "2019-01-28T18:54:43", "url": "https://files.pythonhosted.org/packages/9f/c6/edd61acdeb0d2985112408332f8253493d205bd454a6a6c475bad08ac5c2/conditional-1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4fd46cfa36277cb3a052e546db381421", "sha256": "4948fd9c923a9336e96dded17000fa0978122ee3b46ed146190d07c01953c56c" }, "downloads": -1, "filename": "conditional-1.3.zip", "has_sig": false, "md5_digest": "4fd46cfa36277cb3a052e546db381421", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8291, "upload_time": "2019-01-28T18:54:13", "url": "https://files.pythonhosted.org/packages/63/18/573ba05ce97549e1929b58e39e60789d1ea08de330fdd7dff7355be761ea/conditional-1.3.zip" } ] }