[output/i3bar] Add flush method
flush() terminates a single iteration of widget drawing. see #23
This commit is contained in:
parent
712d958e18
commit
b6eb3ee8e6
6 changed files with 20 additions and 2 deletions
|
@ -52,6 +52,7 @@ class Engine(object):
|
|||
for module in self._modules:
|
||||
widgets += module.widgets()
|
||||
self._output.draw(widgets)
|
||||
self._output.flush()
|
||||
|
||||
self._output.stop()
|
||||
|
||||
|
|
|
@ -8,4 +8,7 @@ class Module(bumblebee.engine.Module):
|
|||
def __init__(self, engine):
|
||||
super(Module, self).__init__(engine)
|
||||
|
||||
def widgets(self):
|
||||
return []
|
||||
|
||||
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
||||
|
|
|
@ -29,4 +29,9 @@ class I3BarOutput(object):
|
|||
})
|
||||
sys.stdout.write(json.dumps(result))
|
||||
|
||||
def flush(self):
|
||||
"""Flushes output"""
|
||||
sys.stdout.write(",\n")
|
||||
sys.stdout.flush()
|
||||
|
||||
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue