[output] Add waiting capability to output
Engine now calls wait on output for further data, is interrupted on new data.
This commit is contained in:
parent
d62258c89d
commit
ea27ccb2c1
2 changed files with 10 additions and 8 deletions
|
@ -1,13 +1,15 @@
|
|||
import threading
|
||||
|
||||
class Output(object):
|
||||
def __init__(self, args):
|
||||
self._callbacks = {}
|
||||
self._wait = threading.Condition()
|
||||
self._wait.acquire()
|
||||
|
||||
def redraw(self):
|
||||
pass
|
||||
self._refresh.acquire()
|
||||
self._refresh.notify()
|
||||
self._refresh.release()
|
||||
self._wait.acquire()
|
||||
self._wait.notify()
|
||||
self._wait.release()
|
||||
|
||||
def add_callback(self, cmd, button, module=None):
|
||||
if module:
|
||||
|
@ -29,6 +31,9 @@ class Output(object):
|
|||
), None)
|
||||
return cb
|
||||
|
||||
def wait(self, interval):
|
||||
self._wait.wait(interval)
|
||||
|
||||
def start(self):
|
||||
pass
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue