diff options
author | Lars Wirzenius <liw@liw.fi> | 2015-10-10 11:52:50 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2015-10-10 11:52:50 +0300 |
commit | 80d809e86b4b417de32ccbe23378830b3e9d3d82 (patch) | |
tree | 455d2ebbcebe62e86f46c8b56f24fc5369644ac9 /speed-test | |
parent | a81fc36cb11446ad687202eb436e29a318111bb2 (diff) | |
download | ttystatus-80d809e86b4b417de32ccbe23378830b3e9d3d82.tar.gz |
Adapt speed-test to interface changes
Diffstat (limited to 'speed-test')
-rwxr-xr-x | speed-test | 25 |
1 files changed, 18 insertions, 7 deletions
@@ -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') - |