summaryrefslogtreecommitdiff
path: root/speed-test
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2015-10-10 11:52:50 +0300
committerLars Wirzenius <liw@liw.fi>2015-10-10 11:52:50 +0300
commit80d809e86b4b417de32ccbe23378830b3e9d3d82 (patch)
tree455d2ebbcebe62e86f46c8b56f24fc5369644ac9 /speed-test
parenta81fc36cb11446ad687202eb436e29a318111bb2 (diff)
downloadttystatus-80d809e86b4b417de32ccbe23378830b3e9d3d82.tar.gz
Adapt speed-test to interface changes
Diffstat (limited to 'speed-test')
-rwxr-xr-xspeed-test25
1 files changed, 18 insertions, 7 deletions
diff --git a/speed-test b/speed-test
index cc5e16d..fb475d5 100755
--- a/speed-test
+++ b/speed-test
@@ -25,18 +25,30 @@ import ttystatus
class FakeTTY(object):
- def write(self, string):
+ def open_tty(self):
pass
-
- def isatty(self):
+
+ def has_capabilities(self):
return True
- def flush(self):
+ def get_up_sequence(self):
+ return ''
+
+ def get_down_sequence(self):
+ return ''
+
+ def get_erase_line_sequence(self):
+ return ''
+
+ def get_width(self):
+ return 80
+
+ def write(self, raw_data):
pass
-output = FakeTTY()
-ts = ttystatus.TerminalStatus(output=output)
+tty = FakeTTY()
+ts = ttystatus.TerminalStatus(_terminal=tty, period=0)
ts.add(ttystatus.ElapsedTime())
ts.add(ttystatus.Literal(' '))
ts.add(ttystatus.Counter('current-file'))
@@ -53,4 +65,3 @@ def loop():
ts['updated-bytes'] = i
cProfile.run('loop()', 'ttystatus.prof')
-