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 /ttystatus | |
parent | a81fc36cb11446ad687202eb436e29a318111bb2 (diff) | |
download | ttystatus-80d809e86b4b417de32ccbe23378830b3e9d3d82.tar.gz |
Adapt speed-test to interface changes
Diffstat (limited to 'ttystatus')
-rw-r--r-- | ttystatus/messager.py | 4 | ||||
-rw-r--r-- | ttystatus/status.py | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/ttystatus/messager.py b/ttystatus/messager.py index f9ab912..8743561 100644 --- a/ttystatus/messager.py +++ b/ttystatus/messager.py @@ -31,7 +31,7 @@ class Messager(object): ''' - def __init__(self, period=None): + def __init__(self, period=None, _terminal=None): self._period = 1.0 if period is None else period self._enabled = True @@ -40,7 +40,7 @@ class Messager(object): self._displayed_message = None # The latest message displayed. self._previous_write_at = 0 # When the latest message was written. - self._terminal = ttystatus.PhysicalTerminal() + self._terminal = _terminal or ttystatus.PhysicalTerminal() try: self._terminal.open_tty() except IOError: diff --git a/ttystatus/status.py b/ttystatus/status.py index 18b3057..b4232d2 100644 --- a/ttystatus/status.py +++ b/ttystatus/status.py @@ -32,8 +32,9 @@ class TerminalStatus(object): ''' - def __init__(self, period=None, messager=None): - self._m = messager or ttystatus.Messager(period=period) + def __init__(self, period=None, messager=None, _terminal=None): + self._m = messager or ttystatus.Messager( + period=period, _terminal=_terminal) self.clear() def add(self, widget): |