{ "info": { "author": "daehruoydeef (Oskar)", "author_email": "author@nodata.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "![pytrol](./docs/pytrol.png)\n\n## What is pytrol\n\npytrol is a helper for subprocess and allows easy process management.\n\n## Installation\n\n#### Automatic (recommended)\n\n```\n$ pip install pytrol\n```\n\n#### Manual\n\n```\n$ git clone git@github.com:daehruoydeef/pytrol.git\n# moving pytrol into your projects lib folder assuming you are cloning it in the same directory\n$ cd myProject\n# create a lib folder inside your python project folder\n$ mkdir lib\n# move the cloned repository inside you lib folder\n$ mv ../pytrol/ ./lib\n```\n\n## Overview\n\n- start\n- startAndWait\n- restart\n- restartAndWait\n- kill\n- isRunning\n- playSound\n- getUser\n- getUserPath\n- notify\n\n## Documentation\n\n#### import\n\n`import pytrol`\n\n`from pytrol import start`\n\n#### start(process)\n\n> starts a process by name. It will not wait for the output and will continue to run, it will not block the current used Thread. The Method Start will append the Process to the system Processes instead of waiting for its output or blocking the thread.\n\n**Example**\n\n`start(\"firefox\")`\n\n`start(\"telegram-desktop\")`\n\n---\n\n#### startAndWait(process)\n\n> starts a process by name. It will wait for the output and will not continue to run, it will block the current used Thread until the process finishes. Finally if the process finishes the method will return the exit code and output.\n\n**Example**\n\n`startAndWait(\"kate\")`\n\n`output = startAndWait(\"tree\")`\n\n---\n\n#### restart(process)\n\n> restarts process and does not wait on return used **start()** internally.\n\n**Example**\n\n`restart(\"telegram-desktop\")`\n\n`restart(\"telegram-desktop\")`\n\n---\n\n**restartAndWait(process)**\n\n> restarts process and does wait on return used **startAndWait()** internally.\n\n**Example**\n\n`startAndWait(\"kate\")`\n\n`output = startAndWait(\"tree\")`\n\n---\n\n#### kill(process)\n\n> kills the process and does not wait for return\n\n**Example**\n\n`kill(\"firefox\")`\n\n`kill(\"telegram-desktop\")`\n\n---\n\n#### isRunning(process)\n\n> return true or false wether the process is running or not\n\n**Example**\n\n`isRunning(\"firefox\")` -> false\n\n`isRunning(\"brave-browser\")` -> true\n\n---\n\n#### playSound(sound)\n\n> plays sound given by path. Will play mp3, wav, flac ... with pulseaudio. If you do not use pulseaudio you might run into troubles.\n\n**Example**\n\n`playSound(\"click.wav\")`\n\n`playSound(\"./sounds/toks/tok.flac\")`\n\n---\n\n#### getUser()\n\n> returns the username that called the script. Note: If you call this script as root you will get \"root\" as username which is probably not intended.\n\n**Example**\n\n`getUser()` -> daeh\n\n---\n\n#### getUserPath()\n\n> return the path to the users home directory. Note: If you run this with root privileges you will get the root path\n\n**Example**\n\n`getUserPath()` -> /home/daeh/\n\n---\n\n#### notify(\"message\")\n\n> sends system notification to the native system notify service\n\n**Example**\n\n`notify(\"Process terminated\")`\n\n`notify(\"update available\")`\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/daehruoydeef/pytrol", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pytrol", "package_url": "https://pypi.org/project/pytrol/", "platform": "", "project_url": "https://pypi.org/project/pytrol/", "project_urls": { "Homepage": "https://github.com/daehruoydeef/pytrol" }, "release_url": "https://pypi.org/project/pytrol/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "easy to use Linux process managment in python", "version": "0.1.1" }, "last_serial": 4824905, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "7aa281830600e8563fcf4094b4f22480", "sha256": "1d1390f588270e4d6584ff47d8ab69b48d88655e10fd8e0a8a090495bf595d8b" }, "downloads": -1, "filename": "pytrol-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "7aa281830600e8563fcf4094b4f22480", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3212, "upload_time": "2019-02-15T14:01:52", "url": "https://files.pythonhosted.org/packages/7f/53/06589f74a13f9681153534d927d3711696e5b69ceefdeb2df9d247dcb804/pytrol-0.1.0-py3-none-any.whl" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "6165f56dc03d3a76b0b55f25b8a0be64", "sha256": "16029493961ea1aeccf4cb0a3bf02a0cfd01c4949fd89044620f919203a460e0" }, "downloads": -1, "filename": "pytrol-0.1.1.tar.gz", "has_sig": false, "md5_digest": "6165f56dc03d3a76b0b55f25b8a0be64", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3168, "upload_time": "2019-02-15T14:09:56", "url": "https://files.pythonhosted.org/packages/c1/fe/4a5bffe8521f479e93b4694e07d08822f0002139faef2d9c85d58383e4a9/pytrol-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6165f56dc03d3a76b0b55f25b8a0be64", "sha256": "16029493961ea1aeccf4cb0a3bf02a0cfd01c4949fd89044620f919203a460e0" }, "downloads": -1, "filename": "pytrol-0.1.1.tar.gz", "has_sig": false, "md5_digest": "6165f56dc03d3a76b0b55f25b8a0be64", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3168, "upload_time": "2019-02-15T14:09:56", "url": "https://files.pythonhosted.org/packages/c1/fe/4a5bffe8521f479e93b4694e07d08822f0002139faef2d9c85d58383e4a9/pytrol-0.1.1.tar.gz" } ] }