[core/output] Implement simple wait

To pace the output lines, implement a simple wait() call for the i3
output.
This commit is contained in:
Tobias Witek 2020-01-26 13:31:20 +01:00
parent fed80fb470
commit a17cd4759c
2 changed files with 5 additions and 1 deletions

View file

@ -17,7 +17,7 @@ def main():
module.update() module.update()
sys.stdout.write(output.draw(module)) sys.stdout.write(output.draw(module))
sys.stdout.write(output.end_status_line()) sys.stdout.write(output.end_status_line())
output.sleep(config.interval()) output.wait(config.interval())
sys.stdout.write(output.stop()) sys.stdout.write(output.stop())

View file

@ -1,4 +1,5 @@
import json import json
import time
class i3(object): class i3(object):
def start(self): def start(self):
@ -13,4 +14,7 @@ class i3(object):
def end_status_line(self): def end_status_line(self):
return '],\n' return '],\n'
def wait(self, interval):
time.sleep(interval)
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4