diff options
author | Lars Wirzenius <liw@liw.fi> | 2015-10-10 11:55:15 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2015-10-10 11:55:15 +0300 |
commit | 9b5ba7f23fe584f5807fea183070cee7594898e1 (patch) | |
tree | d35003e72a91a9da5dfe2f6b9413f32c98721d0d /speed-test | |
parent | 80d809e86b4b417de32ccbe23378830b3e9d3d82 (diff) | |
download | ttystatus-9b5ba7f23fe584f5807fea183070cee7594898e1.tar.gz |
Use .format instead of adding individual widgets
Diffstat (limited to 'speed-test')
-rwxr-xr-x | speed-test | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -49,13 +49,9 @@ class FakeTTY(object): tty = FakeTTY() ts = ttystatus.TerminalStatus(_terminal=tty, period=0) -ts.add(ttystatus.ElapsedTime()) -ts.add(ttystatus.Literal(' ')) -ts.add(ttystatus.Counter('current-file')) -ts.add(ttystatus.Literal(' files found; ')) -ts.add(ttystatus.ByteSize('uploaded-bytes')) -ts.add(ttystatus.Literal(' uploaded ')) -ts.add(ttystatus.Pathname('current-dir')) +ts.format( + '%ElapsedTime() %Counter(current-file) files found; ' + '%ByteSize(uploaded-bytes) uploaded %Pathname(current-dir)') ts['uploaded-bytes'] = 0 num_updates = 1000*1000 |