diff options
author | Lars Wirzenius <liw@liw.fi> | 2010-06-06 15:06:25 +1200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2010-06-06 15:06:25 +1200 |
commit | 9ff7378c072ed1bd2bdcf3e7d22314b2ab567c06 (patch) | |
tree | f071cf9db2fbc6af7f2c61976f04cec813a0f88b /example.py | |
parent | 1155686ab109ddb169376bb4ebdadbf9ea4c062d (diff) | |
download | python-ttystatus-9ff7378c072ed1bd2bdcf3e7d22314b2ab567c06.tar.gz |
Update example program to use TerminalStatus.
Diffstat (limited to 'example.py')
-rw-r--r-- | example.py | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -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__': |