{ "info": { "author": "Xavier Bustamante Talavera", "author_email": "xavier@bustawin.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Programming Language :: Python", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Utilities" ], "description": "Progressive CMD\n###############\nExecutes a cmd while interpreting its completion percentage.\n\nThe completion percentage of the cmd is stored in\nan attribute ``percentage`` and the user can obtain percentage\nincrements by executing ``increment`` or by passing\na *callback* when initializing.\n\nThis class is useful to use within a child thread, so the child thread\nexecutes the cmd, blocking and updating the increment and percentage\nto the parent thread, that can do other things in the meantime.\n\nExamples\n********\nBadblocks\n=========\n\n.. code-block:: python\n\n def my_callback(increment, total):\n print(f'Update: +{increment}% / {total}%.')\n\n def child_thread():\n progress = ProgressiveCmd('badblocks', '-st', 'random', '-w', 'dev/sda1', digits=ProgressiveCmd.DECIMALS, decimal_digits=2, read=35, callback=my_callback)\n progress.run()\n\n t = threading.Thread(target=child_thread)\n t.start()\n\nShred\n=====\n\n.. code-block:: python\n\n def my_callback(increment, total):\n print(f'Update: +{increment} / {total}%.')\n\n def child_thread():\n progress = ProgressiveCmd('shred', '-vn 1', 'dev/sda1', callback=my_callback)\n progress.run()\n\n t = threading.Thread(target=child_thread)\n t.start()\n\nfsarchiver\n==========\n\n.. code-block:: python\n\n def my_callback(increment, total):\n print(f'Update: +{increment} / {total}%.')\n\n def child_thread():\n progress = ProgressiveCmd('fsarchiver', 'restfs', '-v', 'foo/bar/', 'id=0,dest=dev/sda1', callback=my_callback)\n progress.run()\n\n t = threading.Thread(target=child_thread)\n t.start()\n\n\nUsing tqdm\n==========\nYou can use the ``increment`` value to update `tqdm `_:\n\n.. code-block:: python\n\n t = tqdm(total=100)\n\n def my_callback(increment, total):\n t.update(increment)\n\n def child_thread():\n progress = ProgressiveCmd('a-program', callback=my_callback)\n progress.run()\n\n thread = threading.Thread(target=child_thread)\n thread.start()\n\nTesting\n*******\n1. ``git clone`` this project.\n2. Execute ``python setup.py test`` in the project folder.\n\nContributing\n************\nIs a missing or wrong code? Say it in the issues! Feel free to contribute.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bustawin/progressive-cmd", "keywords": "", "license": "AGPLv3 License", "maintainer": "", "maintainer_email": "", "name": "progressive-cmd", "package_url": "https://pypi.org/project/progressive-cmd/", "platform": "", "project_url": "https://pypi.org/project/progressive-cmd/", "project_urls": { "Homepage": "https://github.com/bustawin/progressive-cmd" }, "release_url": "https://pypi.org/project/progressive-cmd/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "Executes a cmd that outputs completion percentages, interpreting them and executing callbacks with the increment and total percentage.", "version": "0.1.1", "yanked": false, "yanked_reason": null }, "last_serial": 6033963, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "d399e51ff2057401c3e8e60bd8b7dc38", "sha256": "9b7094e31493f86011886a89d2e6f9992ee684dfec7a44d3b57190a4f33fefbc" }, "downloads": -1, "filename": "progressive-cmd-0.1.tar.gz", "has_sig": false, "md5_digest": "d399e51ff2057401c3e8e60bd8b7dc38", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5135, "upload_time": "2019-10-26T14:25:09", "upload_time_iso_8601": "2019-10-26T14:25:09.111617Z", "url": "https://files.pythonhosted.org/packages/41/88/9d64f6e0a033ed6833d23c5e1b57435b0f9bdd7ef0dc6050fff149dca39c/progressive-cmd-0.1.tar.gz", "yanked": false, "yanked_reason": null } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "f09b68e6073e15da756eb3c19fe880ff", "sha256": "b6985bdc05eccce77406207a6a6d96eee5a17f1475fa65135f03d8d2a3a27ea6" }, "downloads": -1, "filename": "progressive-cmd-0.1.1.tar.gz", "has_sig": false, "md5_digest": "f09b68e6073e15da756eb3c19fe880ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5348, "upload_time": "2019-10-26T14:27:06", "upload_time_iso_8601": "2019-10-26T14:27:06.827844Z", "url": "https://files.pythonhosted.org/packages/fa/4f/f62944fcef3083bde793eabd80662c531c17d541bda174d78f3e3c288ba7/progressive-cmd-0.1.1.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f09b68e6073e15da756eb3c19fe880ff", "sha256": "b6985bdc05eccce77406207a6a6d96eee5a17f1475fa65135f03d8d2a3a27ea6" }, "downloads": -1, "filename": "progressive-cmd-0.1.1.tar.gz", "has_sig": false, "md5_digest": "f09b68e6073e15da756eb3c19fe880ff", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5348, "upload_time": "2019-10-26T14:27:06", "upload_time_iso_8601": "2019-10-26T14:27:06.827844Z", "url": "https://files.pythonhosted.org/packages/fa/4f/f62944fcef3083bde793eabd80662c531c17d541bda174d78f3e3c288ba7/progressive-cmd-0.1.1.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }