diff options
-rw-r--r-- | README.rst | 34 | ||||
-rw-r--r-- | setup.py | 2 |
2 files changed, 18 insertions, 18 deletions
@@ -79,7 +79,7 @@ Lots of handy formatting codes ("capabilities" in low-level parlance) are available as attributes on ``Terminal`` instances. For example:: from terminator import Terminal - + term = Terminal() print 'I am ' + term.bold + 'bold' + term.normal + '!' @@ -116,7 +116,7 @@ all the time, we simply make such capabilities into callable strings. You can pass the parameters right in:: from terminator import Terminal - + term = Terminal() print 'I am ' + term.color(2) + 'green' + term.normal + '!' @@ -130,27 +130,13 @@ on the `terminfo man page`_ by the name under the "Cap-name" column. .. _`terminfo man page`: http://www.manpagez.com/man/5/terminfo/ -Temporary Repositioning ------------------------ - -Sometimes you need to flit to a certain location, print something, and then -return: for example, when updating a progress bar at the bottom of the screen. -``Terminal`` provides a context manager for doing this concisely:: - - from terminator import Terminal - - term = Terminal() - with term.location(0, term.height): - print 'Here is the bottom.' - print 'This is back where I came from.' - Height and Width ---------------- It's simple to get the height and width of the terminal, in characters:: from terminator import Terminal - + term = Terminal() height = term.height width = term.width @@ -158,6 +144,20 @@ It's simple to get the height and width of the terminal, in characters:: These are newly updated each time you ask for them, so they're safe to use from SIGWINCH handlers. +Temporary Repositioning +----------------------- + +Sometimes you need to flit to a certain location, print something, and then +return: for example, when updating a progress bar at the bottom of the screen. +``Terminal`` provides a context manager for doing this concisely:: + + from terminator import Terminal + + term = Terminal() + with term.location(0, term.height): + print 'Here is the bottom.' + print 'This is back where I came from.' + Pipe Savvy ---------- @@ -10,7 +10,7 @@ if sys.version_info >= (3,): setup( name='terminator', version='1.0.1', - description='A thin, practical wrapper around terminal capabilities', + description='A thin, practical wrapper around terminal formatting, positioning, and more', long_description=open('README.rst').read(), author='Erik Rose', author_email='erikrose@grinchcentral.com', |