From e6618ad0ed66ed459a55ecd903a5627dacf97915 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 7 Jul 2010 09:41:02 +1200 Subject: Add a way for widgets to say "I'm always interested in updates". Fix ElapsedTime to use that. --- example.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'example.py') 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')) -- cgit v1.2.1