From 9b5ba7f23fe584f5807fea183070cee7594898e1 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 10 Oct 2015 11:55:15 +0300 Subject: Use .format instead of adding individual widgets --- speed-test | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'speed-test') diff --git a/speed-test b/speed-test index fb475d5..c3fb646 100755 --- a/speed-test +++ b/speed-test @@ -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 -- cgit v1.2.1