{ "info": { "author": "Jeff Ostendorf", "author_email": "jostendorf@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Operating System :: MacOS", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 2.7" ], "description": "# Wing Commander\n\nStatus: [![Travis Status](https://travis-ci.org/jdost/wingcommander.svg?branch=master)](https://travis-ci.org/jdost/wingcommander)\n\n## Making python's `cmd` module better\n\nThe `cmd` module for python makes writing readline applications accessible, this is\njust an improved wrapper on this. It allows for you to create instances easily \nusing decorators and comes with a varied toolbelt for handling various use cases of\nthe system.\n\n## Easy creation\n\n```python\nfrom wingcommander import WingCommander, run\n\n\nclass TestShell(WingCommander):\n pass\n\n\n@TestShell.command\ndef hello(cmdr, *args):\n ''' Say hello:\n echoes 'hello'\n '''\n print(\"hello\")\n\n\nif __name__ == '__main__':\n commander = TestShell(name=\"sample\")\n run(commander)\n```\n\nThe `TestShell.command` decorator converts the `hello` function into a command for\nthe readline instance. The help text for the command gets pulled from the docstring\n(can be overriden).\n\n## Tab completion\n\nYou can include a `completions` argument in the decorator to enable tab completion \nfor the function as well:\n\n```python\n@TestShell.command(completions=[\"world\", \"jdost\"])\n```\n\nThis takes a function, `dict`, or `list`. If it is a list, it will complete \nanything from that list for every argument, if it is a dictionary, it will complete\na key for the first argument and then one of the values for the second (you can nest\ndictionaries too). For a function, it works the same as the [`completedefault`][1]\nfunction.\n\n[1]: https://docs.python.org/2/library/cmd.html#cmd.Cmd.completedefault\n\n## Subshells\n\nWingCommander supports subshells out of the box. This means that you can import\nand start another WingCommander command shell inside of an existing one and it will\nboth denote the state and transition smoothly.\n\n## Toolbelt\n\nThis also comes with a set of helper functions to ease various output scenarios.\n\n### `watch`\n\n```python\ndef cat():\n f = open(\"editthis.txt\", \"r\")\n return [l.strip() for l in f.readlines()]\n\nwingcommander.watch(cat)\n```\n\nThe first is the `watch` function. This works in the same way as the unix `watch`\ncommand where it will print the output of the supplied function on a determined\nfrequency. The output can be multiline and the area covered will grow as the output\ngets larger. This uses ANSI control characters (has only been tested using `urxvt`\nfor now).\n\n### `tablize`\n\n```python\ndef list_users():\n return [[\"jdost\", \"github\", \"python\"],\n [\"tester\", \"twitter\", \"tweets\"]]\n\nprint(tablize(list_users()))\n```\n\nThe `tablize` function takes a list of lists (or dictionaries) and creates an \naligned output in a table form. The above command would output:\n```\n jdost | github | python\ntester | twitter | tweets\n```\n\nThe function takes various optional arguments such as `max_length`, `keys`, \n`dividers`, `labels`, and `alignment`.\n\n* `max_length` is just a number that limits the width any column can be (if it is a\n list, each number will be applied to the corresponding column)\n* `keys` is for use with a list of dictionaries, rather than printing all the keys,\n just the keys in the list will be printed (in the order they are listed)\n* `dividers` is a list or dictionary giving the characters to use as dividers, the\n order is [`VERTICAL`, `HORIZONTAL`, `CROSS`], any omitted will use the defaults,\n * `VERTICAL` are the pipes that separate the columns, default: `|`\n * `HORIZONTAL` are the spaces that divide the rows, if empty, no divider is used \n (default)\n * `CROSS` is the character used (if both `VERTICAL` and `HORIZONTAL` are set) to\n mark the intersection of these markers\n* `labels` is a list of strings that will label the columns\n* `alignment` is a list of characters that denote how the columns will be aligned,\n options are `c` for center, `r` for right, and `l` for left, you can also use\n `tablize.LEFT`, `tablize.CENTER`, and `tablize.RIGHT` (this is preferable)", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://jdost.us/wingcommander/", "keywords": null, "license": "Apache 2.0", "maintainer": null, "maintainer_email": null, "name": "wingcommander", "package_url": "https://pypi.org/project/wingcommander/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/wingcommander/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://jdost.us/wingcommander/" }, "release_url": "https://pypi.org/project/wingcommander/0.1.5/", "requires_dist": null, "requires_python": null, "summary": "Pythonic commandline applications", "version": "0.1.5" }, "last_serial": 1217835, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "a326f5e2cd2fd675a6cd1ef2df692920", "sha256": "18771d017774be36b2db2a76c4464c293e6dd403b20f385a8b09315261d5d30b" }, "downloads": -1, "filename": "wingcommander-0.1.tar.gz", "has_sig": true, "md5_digest": "a326f5e2cd2fd675a6cd1ef2df692920", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4431, "upload_time": "2014-09-09T03:25:35", "url": "https://files.pythonhosted.org/packages/af/fa/d88e4c8f4fd6d2b482d38825033d4e1531d95d7ae55655bdb9012a1634b9/wingcommander-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "6a4bd1bec22be42e78c2d789528368d8", "sha256": "b10a9b53c7c12707bdd3245d7355d3a0bca0fbc54851e876fe303ff57f8bb768" }, "downloads": -1, "filename": "wingcommander-0.1.1.tar.gz", "has_sig": true, "md5_digest": "6a4bd1bec22be42e78c2d789528368d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4441, "upload_time": "2014-09-09T03:49:00", "url": "https://files.pythonhosted.org/packages/d7/8b/22fefa4b4e6130e882bc15902342d34ab758c66cf1e4fe02936f305cbe7c/wingcommander-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "2e6acf227905098e3fdd1a764455b79a", "sha256": "d42079c54bbf7997abf3e46a501533aca946d50ab5a14bb0eab2f62c13fcd2d1" }, "downloads": -1, "filename": "wingcommander-0.1.2.tar.gz", "has_sig": true, "md5_digest": "2e6acf227905098e3fdd1a764455b79a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4441, "upload_time": "2014-09-09T03:50:47", "url": "https://files.pythonhosted.org/packages/5f/2c/4f0c112e97756d921db67a344712b5c0a3bb3f4b83b4eb31f885465ddf8b/wingcommander-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "b4ae358b35b699e11a77984ec219a180", "sha256": "86cd54015744bcb2c35ed22485e1c6e8bf6afd0ea9c9a7e10f99925d7671f915" }, "downloads": -1, "filename": "wingcommander-0.1.3.tar.gz", "has_sig": true, "md5_digest": "b4ae358b35b699e11a77984ec219a180", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6025, "upload_time": "2014-09-09T03:55:52", "url": "https://files.pythonhosted.org/packages/9c/8c/a4fe442d34c655d8656d480c8b518c4804a5849947a8e37d17c57bf0ee17/wingcommander-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "1f2f155c575b714b06d46466eda67bf5", "sha256": "d73da4ede7037f02c0818a7cc48d1fecdb373ea46bc2a45bffe569efb4c66e3b" }, "downloads": -1, "filename": "wingcommander-0.1.4.tar.gz", "has_sig": true, "md5_digest": "1f2f155c575b714b06d46466eda67bf5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6024, "upload_time": "2014-09-09T03:57:35", "url": "https://files.pythonhosted.org/packages/9c/17/744dafe266a3f474ce634ad0eb0d492e11ed57c78be2f33de4d3ca9f19f0/wingcommander-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "c0bc3379894d7803e96ba1dbce5b389f", "sha256": "73f9abfc1fca55c70e1145d06e49eab0e67fb502f84716caa120ee3bfdc4dbc8" }, "downloads": -1, "filename": "wingcommander-0.1.5-py2-none-any.whl", "has_sig": false, "md5_digest": "c0bc3379894d7803e96ba1dbce5b389f", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9976, "upload_time": "2014-09-09T04:05:02", "url": "https://files.pythonhosted.org/packages/c3/bf/c924efb40075a3ef85a00190f4bed90a1f5e4fbbb98b923412a0189e12ad/wingcommander-0.1.5-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2cdd871cd45d0f7131d98c93de211de3", "sha256": "53f3be8d6985f3d942c2ff08384b5a8502ef5bb7d2dee68df655a64a3c06c9f5" }, "downloads": -1, "filename": "wingcommander-0.1.5.tar.gz", "has_sig": true, "md5_digest": "2cdd871cd45d0f7131d98c93de211de3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6033, "upload_time": "2014-09-09T04:01:38", "url": "https://files.pythonhosted.org/packages/dd/fa/738bf3ee8469e5ee8a4bf78acf54031df31ee095124dffc1423019f096df/wingcommander-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c0bc3379894d7803e96ba1dbce5b389f", "sha256": "73f9abfc1fca55c70e1145d06e49eab0e67fb502f84716caa120ee3bfdc4dbc8" }, "downloads": -1, "filename": "wingcommander-0.1.5-py2-none-any.whl", "has_sig": false, "md5_digest": "c0bc3379894d7803e96ba1dbce5b389f", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9976, "upload_time": "2014-09-09T04:05:02", "url": "https://files.pythonhosted.org/packages/c3/bf/c924efb40075a3ef85a00190f4bed90a1f5e4fbbb98b923412a0189e12ad/wingcommander-0.1.5-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2cdd871cd45d0f7131d98c93de211de3", "sha256": "53f3be8d6985f3d942c2ff08384b5a8502ef5bb7d2dee68df655a64a3c06c9f5" }, "downloads": -1, "filename": "wingcommander-0.1.5.tar.gz", "has_sig": true, "md5_digest": "2cdd871cd45d0f7131d98c93de211de3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6033, "upload_time": "2014-09-09T04:01:38", "url": "https://files.pythonhosted.org/packages/dd/fa/738bf3ee8469e5ee8a4bf78acf54031df31ee095124dffc1423019f096df/wingcommander-0.1.5.tar.gz" } ] }