{ "info": { "author": "Mariusz Pasek", "author_email": "pasiasty@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# app_executor\n\nThis program might be used for launching external executables from python script.\nIt can also collect `stdout` and `stderr` of them and store it into text file.\nIn case of any failure it can also provide some basic stacktrace collection.\n\nImporting `app_executor` package gives an access to two essential classes:\n\n* `app_executor.Process` - this class can be used for direct launching processes\n* `app_executor.AppExecutor` - this class can be used for automatic managing of\nlaunching multiple processes\n\n## Example usage\n\n### `app_executor.Process`\n\nThis code launches `whoami` and aliases it as `MyName` - all warning/error prints\nwill be having this alias for increasing readability. Then it runs the process\nand waits up to 1 second for it to finish. In the end it prints result code and\nactual output (stdout and stderr combined) of executed command.\n\nIn the exit step command will be stopped (firstly `app_executor.Process` will try\nto terminate it and if that fails - kill it). And afterwards it will perform\ncore dump analysis (if core dump was collected during the execution).\n\nAll result files - logs from `gdb`, process itself, core dump and stacktrace will\nbe put into `/some/path/MyName` directory.\n\n```python\nimport app_executor\nwith app_executor.Process(name='MyName',\n cmd='whoami',\n parent_context_dir='/some/path') as process:\n process.run()\n if not process.wait(timeout=1):\n raise Exception('Process hanged for too long!')\n\n print('Returncode was: {}'.format(process.get_rc()))\n print('Output of whoami: {}'.format(process.get_logfile()))\n```\n\n### `app_executor.AppExecutor`\n\nThis code works similar to former. Here execution path is passed once for all\nprocesses launched later on. `app_executor.AppExecutor` can either assign\naliases by itself (`process_1`, `process_2`, etc.) or user can set them manually.\n\n`run` function returns `app_executor.Process` object that can be used to interact\nwith the process later on (similarly as in former example).\n\nIn the exit step `app_executor.AppExecutor` will stop every child process and\nperform dump analysis if core dump were collected. All result files will be stored\nunder the path `/some/path/$NAME_OF_THE_PROCESS`.\n\n```python\nimport app_executor\nwith app_executor.AppExecutor('/some/path') as executor:\n p1 = executor.run('whoami')\n p2 = executor.run('sleep 1', 'MyCustomAlias')\n\n # ...\n # operations on p1 and p2 app_executor.Process objects\n # ...\n\n```\n\n### `executor` fixture\n\nTogether with installing `app_executor` package `executor` pytest fixture becomes\navailable. It creates `app_executor.AppExecutor` and passes `tmpdir` as work\ndirectory to it. On fixture teardown all spawned processes are stopped.\n\n```python\n\ndef test_some_executing(executor):\n p1 = executor.run('whoami')\n p2 = executor.run('sleep 1')\n\n # ...\n # operations on p1 and p2 app_executor.Process objects\n # ...\n\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pasiasty/app-executor", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "app-executor", "package_url": "https://pypi.org/project/app-executor/", "platform": "", "project_url": "https://pypi.org/project/app-executor/", "project_urls": { "Homepage": "https://github.com/pasiasty/app-executor" }, "release_url": "https://pypi.org/project/app-executor/1.0.4/", "requires_dist": null, "requires_python": "", "summary": "Tool for safe launching external processes", "version": "1.0.4" }, "last_serial": 4867401, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "4d42d473b41a08d03703d79f09bca1b6", "sha256": "177cd36288a71e0d9f901d1cada08ac2643a7108ba427a55dd4be8b64b452063" }, "downloads": -1, "filename": "app_executor-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4d42d473b41a08d03703d79f09bca1b6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7772, "upload_time": "2019-02-25T13:14:37", "url": "https://files.pythonhosted.org/packages/cd/67/e634a87cf97eb6dba62fcd7d9bf6cc3c8616d7f15163ed6cc20cd979ac33/app_executor-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "32d5dc0d9d991d4eb9f7c6a519c4772a", "sha256": "ff78dd10828310ec3bef4104ee1feb2eb46aaeeee023aa71c9f9742d543f59fd" }, "downloads": -1, "filename": "app_executor-1.0.0.tar.gz", "has_sig": false, "md5_digest": "32d5dc0d9d991d4eb9f7c6a519c4772a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5826, "upload_time": "2019-02-25T13:14:38", "url": "https://files.pythonhosted.org/packages/4a/86/aec7a73c82239e6c55d12329e641a01d6784ad420f8cd4a112c63bc2bba5/app_executor-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "5df6dc6d35158552b5595a637ef58352", "sha256": "391693d307e85ab811092c859f493f387a226f03c072de967a83726f0d1b9aad" }, "downloads": -1, "filename": "app_executor-1.0.1.tar.gz", "has_sig": false, "md5_digest": "5df6dc6d35158552b5595a637ef58352", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5858, "upload_time": "2019-02-25T13:29:08", "url": "https://files.pythonhosted.org/packages/93/a2/2a0923420454df95af2617315afac838027c9ee348730492f633d8820560/app_executor-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "10b4826e6e8f04c538b4a06bb81720a1", "sha256": "327cc37fb4e40f0dbb310239133f0e7ef8c3f75c66e74ffc6729e8f309c3075f" }, "downloads": -1, "filename": "app_executor-1.0.2.tar.gz", "has_sig": false, "md5_digest": "10b4826e6e8f04c538b4a06bb81720a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5748, "upload_time": "2019-02-25T23:56:14", "url": "https://files.pythonhosted.org/packages/34/d8/3c82518be12d2bc917fc2c401b594569357958ce3459a1bbe62acd8c218e/app_executor-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "5ce8f1a24a7d70fd48373d138550b38b", "sha256": "85789764cde88ecd1835e21277d63b459b17b62ba5630556c5603bf53c3e56b1" }, "downloads": -1, "filename": "app_executor-1.0.3.tar.gz", "has_sig": false, "md5_digest": "5ce8f1a24a7d70fd48373d138550b38b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5753, "upload_time": "2019-02-25T23:57:35", "url": "https://files.pythonhosted.org/packages/59/c7/d97085170be889de7aaa8db25e61365c752e66a9ee3dc0f3441abb24abb9/app_executor-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "7dcde5a406029f2a3ee45908cdf09161", "sha256": "dc324231fdf78a0bc2c3e68d16f3c3be82ef661ef2fe31694bfbec41bb2e87dd" }, "downloads": -1, "filename": "app_executor-1.0.4.tar.gz", "has_sig": false, "md5_digest": "7dcde5a406029f2a3ee45908cdf09161", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5759, "upload_time": "2019-02-26T00:14:39", "url": "https://files.pythonhosted.org/packages/61/9c/c3674cc98145eb9404744321a6c0d00ef58c6009220a042d45e8bb61d81f/app_executor-1.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7dcde5a406029f2a3ee45908cdf09161", "sha256": "dc324231fdf78a0bc2c3e68d16f3c3be82ef661ef2fe31694bfbec41bb2e87dd" }, "downloads": -1, "filename": "app_executor-1.0.4.tar.gz", "has_sig": false, "md5_digest": "7dcde5a406029f2a3ee45908cdf09161", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5759, "upload_time": "2019-02-26T00:14:39", "url": "https://files.pythonhosted.org/packages/61/9c/c3674cc98145eb9404744321a6c0d00ef58c6009220a042d45e8bb61d81f/app_executor-1.0.4.tar.gz" } ] }