summaryrefslogtreecommitdiff
path: root/example.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2010-06-13 20:52:45 +1200
committerLars Wirzenius <liw@liw.fi>2010-06-13 20:52:45 +1200
commitf188b3cee956afe0b7264712a7e47e5875603367 (patch)
tree3a233cb0caa6dce8d69d62f96458b5d8b1b1b959 /example.py
parent705f90a2108a22c4cf1ab334ebb98b1f00620fa3 (diff)
downloadttystatus-f188b3cee956afe0b7264712a7e47e5875603367.tar.gz
Add RemainingTime to example.py.
Updates to RemainingTime tests, as well.
Diffstat (limited to 'example.py')
-rw-r--r--example.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/example.py b/example.py
index e12d0d7..a1a2c73 100644
--- a/example.py
+++ b/example.py
@@ -40,13 +40,15 @@ def main():
ts.clear()
ts.add(ttystatus.Literal('Finding symlinks: '))
+ ts.add(ttystatus.Counter('symlink'))
+ ts.add(ttystatus.Literal(' found; now at '))
ts.add(ttystatus.Index('pathname', 'pathnames'))
ts.add(ttystatus.Literal(' ('))
ts.add(ttystatus.PercentDone('done', 'total', decimals=2))
ts.add(ttystatus.Literal(' done) '))
+ ts.add(ttystatus.RemainingTime('done', 'total'))
+ ts.add(ttystatus.Literal(' '))
ts.add(ttystatus.ProgressBar('done', 'total'))
- ts.add(ttystatus.Counter('symlink'))
- ts.add(ttystatus.Literal(' symlinks found'))
ts['pathnames'] = pathnames
ts['done'] = 0
ts['total'] = len(pathnames)
@@ -55,7 +57,7 @@ def main():
ts['pathname'] = pathname
if os.path.islink(pathname):
ts['symlink'] = pathname
- ts.notify('Symlink! %s' % pathname)
+# ts.notify('Symlink! %s' % pathname)
ts['done'] += 1
ts.finish()