{ "info": { "author": "Matthew T. Kennerly (mtkennerly)", "author_email": "mtkennerly@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Utilities" ], "description": "Inspired by programs that return 1 on success, exesexe lets you wrap a call\nto an executable and selectively override its return codes. This allows you,\nfor example, to use an aberrant installer with configuration management\nsoftware that expects programs to return 0 when successful.\n\nexesexe will use the first argument it receives as its own directive, but all\nother arguments will be executed without modification. The directive is a\ncomma-separated list, where each segment may have one of these forms:\n\n```\n1 whitelist 1 (convert to 0)\n-1=2 substitute -1 with 2\n5:8=9 substitute 5, 6, 7, and 8 with 9\n!1 blacklist 1 (don't convert 1 at all; convert everything else to 0)\n*=3 substitute all others with 3\n```\n\nExamples:\n * `1,-1,2=3`\n * Convert 1 and -1 to 0.\n * Convert 2 to 3.\n\n * `!2`\n * Don't convert 2.\n * Convert everything else to 0.\n\n * `!-4=2`\n * Don't convert -4.\n * Convert everything else to 2.\n\n * `*=10`\n * Return 10 no matter what.\n\nThe precedence order is whitelists, specific substitutions, blacklists,\nthen *-substitutions, so `*=4,1=2,!3` would convert 1 to 2 rather than 4 or 0.\nThe lexical order only matters for overlapping segments, like `1=0,1=2`,\nwhere the rightmost segment overrides the left segments.\n\nSuppose you want to run the executable `foo`. You could issue any of these:\n\n```\nexesexe 1 foo # return 0 if foo returns 1\nexesexe 3=4 foo # return 4 if foo returns 3\nexesexe *=0 foo # always return 0\nexesexe !2 foo # return 0 if foo does not return 2\nexesexe !2,3=4 foo # if foo returns 3, return 4;\n # else, if foo does not return 2, return 0;\n # else, pass back foo's real return code\n```\n\nYou can also use exesexe as a library:\n\n```python\nimport exesexe\nwhitelist, blacklist, substitutions = exesexe.parse_directive(\"1,!2,3=4\")\nexesexe.interpret(\n \"foo --bar\",\n whitelist=[1],\n blacklist=[2],\n substitutions={3: 4, \"*\": 1}\n)\n```\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/mtkennerly/exesexe", "keywords": "return code", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "exesexe", "package_url": "https://pypi.org/project/exesexe/", "platform": "", "project_url": "https://pypi.org/project/exesexe/", "project_urls": { "Homepage": "https://github.com/mtkennerly/exesexe" }, "release_url": "https://pypi.org/project/exesexe/1.0.1/", "requires_dist": [ "invoke; extra == 'dev'", "pyinstaller; extra == 'dev'", "tox; extra == 'dev'" ], "requires_python": "", "summary": "Manipulate return codes from executables", "version": "1.0.1" }, "last_serial": 2841369, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "2d3ee1873a3c442dc2e00a56b79b0721", "sha256": "e61518f8547d390725ab16fbc71b50d22b7cc83f61062f9153e6d4d07cd34f6f" }, "downloads": -1, "filename": "exesexe-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2d3ee1873a3c442dc2e00a56b79b0721", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5639, "upload_time": "2017-05-01T02:08:19", "url": "https://files.pythonhosted.org/packages/8d/6d/37e97edb46aea6050768275f613c79a087174bdcb6f582d6288db92c2187/exesexe-1.0.0-py2.py3-none-any.whl" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "d80f5d3b2430ea05dcac8cf837260b31", "sha256": "32760a70e8a13d316df9587f765d6fa3c36a01f6c66c999a181fb3412183be7b" }, "downloads": -1, "filename": "exesexe-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d80f5d3b2430ea05dcac8cf837260b31", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5853, "upload_time": "2017-05-01T04:55:32", "url": "https://files.pythonhosted.org/packages/8a/1e/a590983ead1be6de845007d0fee45acd2423daa5d411c60a335eb68da5b7/exesexe-1.0.1-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d80f5d3b2430ea05dcac8cf837260b31", "sha256": "32760a70e8a13d316df9587f765d6fa3c36a01f6c66c999a181fb3412183be7b" }, "downloads": -1, "filename": "exesexe-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d80f5d3b2430ea05dcac8cf837260b31", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5853, "upload_time": "2017-05-01T04:55:32", "url": "https://files.pythonhosted.org/packages/8a/1e/a590983ead1be6de845007d0fee45acd2423daa5d411c60a335eb68da5b7/exesexe-1.0.1-py2.py3-none-any.whl" } ] }