This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
minchin.text
============

Python library for text formatting on the command line.

Avaiable Data
-------------

\_\_version\_\_
```````````````
library version.

re_ansi_control_codes
`````````````````````
Compiled regex pattern for ANSI control codes, including colors.

re_weburl
`````````
Compiled regex pattern for web URL's -- http, https, and naked domains like "example.com"

re_allurl
`````````
Compiled regex pattern to match all URL's, including "mailto:foo@example.com", "x-whatever://foo", etc.

Available Commands
------------------

length_no_ansi(mystring)
````````````````````````
Takes a string, strips out the ANSI escape codes
(used for colouring terminal output, etc.), and returns
the length of the resulting string

centered (mystring, linewidth=79, fill=" ")
```````````````````````````````````````````
Takes a string, centres it, and pads it on both sides

clock_on_right(mystring)
````````````````````````
Takes a string, and prints it with the time right aligned

query_yes_no(question, default="yes")
`````````````````````````````````````
Ask a yes/no question via raw_input() and return their answer.

- "question" is a string that is presented to the user.
- "default" is the presumed answer if the user just hits <enter>. It must be "yes" (the default), "no" or None (meaning an answer is required of the user).
- The "answer" return value is one of "yes" or "no".

query_yes_no_all(question, default="yes")
`````````````````````````````````````````
Ask a yes/no/all question via raw_input() and return their answer.

- "question" is a string that is presented to the user.
- "default" is the presumed answer if the user just hits <enter>. It must be "yes" (the default), "no", "all" or None (meaning an answer is required of the user).
- The "answer" return value is one of "yes", "no", or "all".

def query_yes_quit(question, default="quit")
````````````````````````````````````````````
Ask a yes/quit question via raw_input() and return their answer.

- "question" is a string that is presented to the user.
- "default" is the presumed answer if the user just hits <enter>. It must be "yes" (the default), "quit" or None (meaning an answer is required of the user).
- The "answer" return value is one of "yes" or "quit".

wait(sec)
`````````
Prints a timer with the format 0:00 to the console,
and then clears the line when the timer is done.

title(mytitle)
``````````````
Takes 'mytitle', centers it, and prints it in yellow letters on a blue background.


subtitle(mysubtitle)
````````````````````
Takes 'mysubtitle', centers it, and prints it in bright (white) letters on a normal (black) background.

progressbar (class)
-------------------

This class is used to create and then update a 'progress bar', like:

.. code-block:: shell

[================> ] 17 / 70


progressbar(current=0, maximum=100, bar_color=colorama.Fore.GREEN)
``````````````````````````````````````````````````````````````````
Creates a progress bar class. Prints the progress bar.

progressbar.update(currently=None)
``````````````````````````````````
Updates the value of the progress bar and prints it.

progressbar.reset()
```````````````````
Sets the value of the progress bar to 0 (zero) and prints it.

Code
----

The code is available at `https://github.com/MinchinWeb/minchin.text <https: github.com="" minchinweb="" minchin.text="">`_

Contributions are welcome!

Tests
-----
Located in the `test` folder. Each is a "visual test", so they need to be run and the output manually examined.

License
-------
The code is licensed under the MIT license. See that attached `LICENSE` file.


v 5.1.0 [2017-01-29]
==================
- `minchin.text.progressbar()` will only print (by default) every 0.1 seconds
- fix progressbar bug where "overfull" bars would go on to multiple lines
- add `get_terminal_size()`
- upgrade release machinery

v 5.0 [2015-06-10]
==================
- move package to `minchin.text`
- add tests for `minchin.text.centered()`
- add end character to progress bar
- add documentation to README.rst

v 4.4 [2014-10-26]
==================
- typographic changes to allow wmtext to work in Python 3

v 4.1 [2014-03-10]
==================
- allow access as a direct object. i.e. use `import wmtext` rather than `from wmtext import wmtext`

v 4.0 [2014-02-06]
==================
- packaged as a separate module
- added progress bar
- first public release

v 3.2 [2014-02-02]
==================
- add `length_no_ansi()` allowing you to determine the length of a string after stripping out ANSI codes.
Release History

Release History

5.1.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

5.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

5.0.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
minchin.text-5.1.0-py2.py3-none-any.whl (10.5 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Jan 30, 2017
minchin.text-5.1.0.tar.gz (9.2 kB) Copy SHA256 Checksum SHA256 Source Jan 30, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting