From 80d809e86b4b417de32ccbe23378830b3e9d3d82 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 10 Oct 2015 11:52:50 +0300 Subject: Adapt speed-test to interface changes --- speed-test | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'speed-test') 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') - -- cgit v1.2.1