summaryrefslogtreecommitdiff
path: root/example.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2010-07-07 09:41:02 +1200
committerLars Wirzenius <liw@liw.fi>2010-07-07 09:41:02 +1200
commite6618ad0ed66ed459a55ecd903a5627dacf97915 (patch)
treefdd8b7ce20622f8df2d52274659895b8c7937410 /example.py
parent129e223f07e7d090655da2bfdaa6262cfa399f2e (diff)
downloadttystatus-e6618ad0ed66ed459a55ecd903a5627dacf97915.tar.gz
Add a way for widgets to say "I'm always interested in updates".
Fix ElapsedTime to use that.
Diffstat (limited to 'example.py')
-rw-r--r--example.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/example.py b/example.py
index a1a2c73..3b7b8c8 100644
--- a/example.py
+++ b/example.py
@@ -25,7 +25,8 @@ import ttystatus
def main():
ts = ttystatus.TerminalStatus(period=0.1)
- ts.add(ttystatus.Literal('Looking for files: '))
+ ts.add(ttystatus.ElapsedTime())
+ ts.add(ttystatus.Literal(' Looking for files: '))
ts.add(ttystatus.Counter('pathname'))
ts.add(ttystatus.Literal(' found, currently in '))
ts.add(ttystatus.Pathname('dirname'))
@@ -39,7 +40,8 @@ def main():
pathnames.append(pathname)
ts.clear()
- ts.add(ttystatus.Literal('Finding symlinks: '))
+ ts.add(ttystatus.ElapsedTime())
+ ts.add(ttystatus.Literal(' Finding symlinks: '))
ts.add(ttystatus.Counter('symlink'))
ts.add(ttystatus.Literal(' found; now at '))
ts.add(ttystatus.Index('pathname', 'pathnames'))