2016-10-30 17:56:04 +01:00
|
|
|
|
|
|
|
class Output(object):
|
2016-10-31 10:45:15 +01:00
|
|
|
def __init__(self, theme):
|
|
|
|
self._theme = theme
|
2016-11-01 07:46:26 +01:00
|
|
|
self._callbacks = {}
|
|
|
|
|
|
|
|
def add_callback(self, cmd, button, module=None, instance=None):
|
|
|
|
self._callbacks[(
|
|
|
|
button,
|
|
|
|
module,
|
|
|
|
instance
|
|
|
|
)] = cmd
|
|
|
|
|
|
|
|
def callback(self, event):
|
|
|
|
cb = self._callbacks.get((
|
|
|
|
event.get("button", -1),
|
|
|
|
event.get("name", None),
|
|
|
|
event.get("instance", None)
|
|
|
|
), None)
|
|
|
|
if cb is not None: return cb
|
|
|
|
cb = self._callbacks.get((
|
|
|
|
event.get("button", -1),
|
|
|
|
event.get("name", None),
|
|
|
|
None
|
|
|
|
), None)
|
|
|
|
if cb is not None: return cb
|
|
|
|
cb = self._callbacks.get((
|
|
|
|
event.get("button", -1),
|
|
|
|
None,
|
|
|
|
None
|
|
|
|
), None)
|
|
|
|
return cb
|
2016-10-31 10:45:15 +01:00
|
|
|
|
|
|
|
def theme(self):
|
|
|
|
return self._theme
|
|
|
|
|
2016-10-30 17:56:04 +01:00
|
|
|
def start(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def add(self, obj):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def stop(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|