From 9ff7378c072ed1bd2bdcf3e7d22314b2ab567c06 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 6 Jun 2010 15:06:25 +1200 Subject: Update example program to use TerminalStatus. --- example.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'example.py') diff --git a/example.py b/example.py index 476c4aa..d7938b7 100644 --- a/example.py +++ b/example.py @@ -24,13 +24,17 @@ import ttystatus def main(): - m = ttystatus.Messager(period=0.1) + ts = ttystatus.TerminalStatus(period=0.1) + ts.add(ttystatus.Literal('Finding symlinks: ')) + ts.add(ttystatus.String('pathname')) + for dirname, subdirs, basenames in os.walk(sys.argv[1]): for pathname in [os.path.join(dirname, x) for x in basenames]: - m.write(pathname) + ts['pathname'] = pathname if os.path.islink(pathname): - m.notify('Symlink! %s' % pathname) - m.finished() + ts.notify('Symlink! %s' % pathname) + + ts.finish() if __name__ == '__main__': -- cgit v1.2.1