summaryrefslogtreecommitdiff
path: root/README
blob: 47ff0cec02d06b6a11f7da9b661ac1f3c6a6fcb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Progress and status updates on terminals
========================================

`ttystatus` is a Python library for showing progress reporting and status
updates on terminals, for (Unix) command line programs. Output is 
automatically adapted to the width of the terminal: truncated if it does
not fit, and re-sized if the terminal size changes.

Output is provided via widgets. Each widgets formats some data into
a suitable form for output. It gets the data either via its initializer,
or from key/value pairs maintained by the master object. The values are
set by the user. Every time a value is updated, widgets get updated
(although the terminal is only updated every so often to give user time
to actually read the output).

The output from ttystatus goes to the terminal (`/dev/tty`) and is
restricted to a single line.

See example.py for an example of how to use the library.


Installation
------------

* Use Python distutils (setup.py) as usual.
* If possible, use the Debian packaging when you can.

You will need some other stuff to run automatic tests:

* http://liw.fi/coverage-test-runner/ for unit tests.


Hacking
-------

See <http://liw.fi/ttystatus/> for information about version control
trees, etc.

Run `./check` for unit tests. If you make any changes, run it
first, and don't stop fixing things until coverage is 100% again.

If you do make any improvements, I would welcome patches. Send me
(see http://liw.fi/contact/ for details) a patch, a bzr bundle, or 
a link to a bzr branch I can merge from. Thanks! 


Legalese
--------

Copyright 2010-2013 Lars Wirzenius

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.


See also
--------

* http://pypi.python.org/pypi/progressbar/ is another library for this.
  It is older and more well-established, but, I think, a bit less
  flexible. For example, it seems to assume there is only one percentage
  value that gets reported.