diff options
Diffstat (limited to 'ttystatus/bytespeed.py')
-rw-r--r-- | ttystatus/bytespeed.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ttystatus/bytespeed.py b/ttystatus/bytespeed.py index 7f54b86..3331069 100644 --- a/ttystatus/bytespeed.py +++ b/ttystatus/bytespeed.py @@ -22,10 +22,11 @@ import ttystatus class ByteSpeed(ttystatus.Widget): '''Display data size in bytes, KiB, etc.''' + + static_width = False def __init__(self, name): self.name = name - self.interesting_keys = [name] self._bytes = 0 self._started = None @@ -34,7 +35,7 @@ class ByteSpeed(ttystatus.Widget): return time.time() - def format(self): + def render(self, width): units = ( (1024**4, 2, 'TiB/s'), (1024**3, 2, 'GiB/s'), @@ -55,7 +56,7 @@ class ByteSpeed(ttystatus.Widget): unit) return '%.0f B/s' % speed - def update(self, master, width): + def update(self, master): if self._started is None: self._started = self.now() self._bytes = master[self.name] |