{ "info": { "author": "Jeroen Dhollander", "author_email": "", "bugtrack_url": null, "classifiers": [], "description": "Python More or Less\n*******************\n\nThis library makes it easy to add ``more`` paginating to your application.\n\n\nThis means that it will print a full page of output,\nafter which it will prompt the user on how to continue.\n\nIt supports multiple continue actions, and full control over where the input\ncomes from, and where the output is printed to.\n\nAvailable continue actions\n===========================\n\nThis library supports all the usual continue actions, like space for another page,\nenter for a single more line, and many more.\n\nTo see all the available operations, press ``h`` at the ``--More--`` prompt::\n\n -------------------------------------------------------------------------------\n Most commands can optionally be preceded by an integer argument k.\n The default values are printed in brackets.\n A star (*) indicates the value of k becomes the new default.\n -------------------------------------------------------------------------------\n Display next k lines of text [current screen size]\n Display next k lines of text [1]*\n q or Q or Exit from more\n = Display current line number\n l Toggle printing line number on every line [currently disabled]\n / Search for kth occurrence of the regular expression [1]\n n Search for kth occurrence of the last regular expression [1]\n . Repeat previous command\n h or ? Display this help text\n -------------------------------------------------------------------------------\n\nHow to use this library\n=======================\n\nAll you need to do is call ``paginate`` and pass in your input lines:\n\n.. code:: python\n\n import more_or_less\n\n more_or_less.paginate(input=iterator_or_queue)\n\nThis uses your terminal's screen height, and prints the text to ``stdout``.\n\nDo you want to use something other than ``stdout``? Just pass in what output to use\n\n.. code:: python\n\n more_or_less.paginate(input=iterator, output=stderr)\n\nThis can be any object that has a ``write`` and ``flush`` method\n\n.. code:: python\n\n class MyCustomOutput(object):\n def write(self, text):\n pass\n\n def flush(self): \n pass\n\n def paginate(iterator):\n more_or_less.paginate(input=iterator, output=myCustomOutput())\n\nTo use another screen height than your terminal session, pass in a ``ScreenDimensions`` object, like the built-in ``FixedSizeScreen``:\n\n.. code:: python\n\n import more_or_less\n\n more_or_less.paginate(\n input=iterator,\n screen_dimensions=more_or_less.FixedSizeScreen(height=25)\n )\n\nFinally, to run the paginator asynchronously, simply pass in ``asynchronous=True``\n\n.. code:: python\n\n more_or_less.paginate(\n input=iterator,\n asynchronous=True\n )\n\nThis is especially useful if you use a ``queue.Queue`` as input.\nIn this case, use ``more_or_less.END_OF_INPUT`` to let our paginator know it should stop,\nand join the returned object to wait for the paginator to end:\n\n.. code:: python\n\n my_queue = queue.Queue()\n controller = more_or_less.paginate(input=my_queue, asynchronous=True)\n\n my_queue.put('first line\\n')\n my_queue.put('second line\\n')\n # Signal we're done\n my_queue.put(more_or_less.END_OF_INPUT)\n # Wait for the pagination to complete\n controller.join()\n\nAdvanced topics\n###############\n\nAdding plugins\n----------------\n\nAll actions you take at the ``more`` prompt (space for one more page, enter for one more line, and so on) are installed using plugins.\n\nThis makes it easy to extend the functionality, by creating your own ``MorePlugin``\nand installing it through ``more_or_less.add_plugin``.\n\nFor examples, see our `rainbow plugin `_ and our `rainbow toggle `_.\n\n\nChanging prompt reader\n-----------------------\n\nWhen the output is paused waiting for a continue action,\nwe read this action from ``stdin``.\n\nThis can be changed by passing in a custom ``Input`` object.\nFor example, any time we hit a more prompt the following code will automatically search for ``\"the search pattern\"``:\n\n.. code:: python\n\n\tclass MyCustomInput(more_or_less.Input):\n\n\t\tdef prompt(self, message):\n\t\t # Return a full line of input.\n\t\t # Used for example after typing a '/'\n\t\t return \"the search pattern\"\n\n\t\tdef get_character(self, message):\n\t\t # Returns a single input character\n\t\t return '/'\n\t\n\tmore_or_less.paginate(input=iterator, prompt=MyCustomInput())", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jeroen-dhollander/python-more-or-less", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "more-or-less", "package_url": "https://pypi.org/project/more-or-less/", "platform": "", "project_url": "https://pypi.org/project/more-or-less/", "project_urls": { "Homepage": "https://github.com/jeroen-dhollander/python-more-or-less" }, "release_url": "https://pypi.org/project/more-or-less/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "Library for adding 'more' like paging functionality to your Python application", "version": "1.0.0" }, "last_serial": 4331085, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "f972c72c5215c284ea1097a9d9a14938", "sha256": "f92a7306ac469f9fceaffb48bb94e149450df373c6896bd95457f634d0086dd3" }, "downloads": -1, "filename": "more-or-less-0.1.0.tar.gz", "has_sig": false, "md5_digest": "f972c72c5215c284ea1097a9d9a14938", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3847, "upload_time": "2018-09-19T04:51:47", "url": "https://files.pythonhosted.org/packages/f9/5b/0430c72964eb44be7bf0533892ad1e19bd915339de478247ed1a9896219e/more-or-less-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "2f7303af782e309b6b7ba56d22055369", "sha256": "7e9db813b21ce0094cd816f48eb39247dc8ae1013b31fa33f9654888c93bfb77" }, "downloads": -1, "filename": "more-or-less-0.1.1.tar.gz", "has_sig": false, "md5_digest": "2f7303af782e309b6b7ba56d22055369", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3986, "upload_time": "2018-09-20T05:24:57", "url": "https://files.pythonhosted.org/packages/1d/ba/9af2fbaa522e44f076703e02dd188e0710a93c69436319491ab1cd72863a/more-or-less-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "83cd439320c1b492193dd8fec07147f3", "sha256": "e16f07af9c9bb3889884d599e58d833e3d34101e8a961984c1a021eabd702a6e" }, "downloads": -1, "filename": "more-or-less-0.1.2.tar.gz", "has_sig": false, "md5_digest": "83cd439320c1b492193dd8fec07147f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7413, "upload_time": "2018-09-24T03:19:59", "url": "https://files.pythonhosted.org/packages/d5/a3/7dfb1dbc8f1089e5c8610bb2b965c136783ae8ae99b0e293556f29111964/more-or-less-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "e0a45424a854ca3c814c96c4809400e8", "sha256": "e313a8782406f0c88483a2736bd01e98d4b7246ea127f47fb747ee537dd2f47f" }, "downloads": -1, "filename": "more-or-less-0.1.3.tar.gz", "has_sig": false, "md5_digest": "e0a45424a854ca3c814c96c4809400e8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7447, "upload_time": "2018-09-24T15:48:34", "url": "https://files.pythonhosted.org/packages/79/4d/efe3bf6d39cdc193e6fd8d69dbe15966ddf5efa7a8d6df8a24c30f6ed177/more-or-less-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "74721df46267e60ca3c9659166c6c598", "sha256": "98d7dee25b22f7dbdf2479810017071f725232e27d221821b3fdc747d0bf6c58" }, "downloads": -1, "filename": "more-or-less-0.1.4.tar.gz", "has_sig": false, "md5_digest": "74721df46267e60ca3c9659166c6c598", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8954, "upload_time": "2018-09-25T04:50:29", "url": "https://files.pythonhosted.org/packages/fc/ab/8ed25f157c42e27a3aa23cb0886cf28a019644f0e44f54b73cc0e1b59392/more-or-less-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "5bbb9bf8d43653f31246fb8fdb242fd2", "sha256": "2ce653b849cac607066a8605d57e9d2d6f11cf4f33d2d114356e0e87f2af9e35" }, "downloads": -1, "filename": "more-or-less-0.1.5.tar.gz", "has_sig": false, "md5_digest": "5bbb9bf8d43653f31246fb8fdb242fd2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12236, "upload_time": "2018-09-30T19:28:09", "url": "https://files.pythonhosted.org/packages/4e/a9/a1a5fa55bb5610bbed0f03b0cb097ea6cd9c7eb736968f533adbfbe4bae1/more-or-less-0.1.5.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "a86a62353cc35d74d923ee05b5a850d8", "sha256": "b11ed2779e2174b47ffb69975a1ce78e142742f11584aab1e8b3f28158df264e" }, "downloads": -1, "filename": "more-or-less-1.0.0.tar.gz", "has_sig": false, "md5_digest": "a86a62353cc35d74d923ee05b5a850d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13993, "upload_time": "2018-10-02T03:03:33", "url": "https://files.pythonhosted.org/packages/18/ca/3d8d4f139b3105bce52dc502788a6ad793376d03151631eab4e86034985c/more-or-less-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a86a62353cc35d74d923ee05b5a850d8", "sha256": "b11ed2779e2174b47ffb69975a1ce78e142742f11584aab1e8b3f28158df264e" }, "downloads": -1, "filename": "more-or-less-1.0.0.tar.gz", "has_sig": false, "md5_digest": "a86a62353cc35d74d923ee05b5a850d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13993, "upload_time": "2018-10-02T03:03:33", "url": "https://files.pythonhosted.org/packages/18/ca/3d8d4f139b3105bce52dc502788a6ad793376d03151631eab4e86034985c/more-or-less-1.0.0.tar.gz" } ] }