new: grid plugin can now do messaging

This commit is contained in:
Simone Margaritelli
2019-10-11 23:29:34 +02:00
parent 7520d4dd6f
commit dfaf3418af
5 changed files with 54 additions and 5 deletions

View File

@ -12,6 +12,13 @@ class State(object):
self._state[key] = elem
self._changes[key] = True
def has_element(self, key):
return key in self._state
def remove_element(self, key):
del self._state[key]
self._changes[key] = True
def add_listener(self, key, cb):
with self._lock:
self._listeners[key] = cb