3 from ....util.pluggable import IsSubclass, construct_graph
\r
14 """List of handler modules. TODO: autodiscovery
\r
17 class Handler (object):
\r
18 """Base class for :class:`~hooke.interaction.Request` handlers.
\r
20 :attr:`name` identifies the request type and should match the
\r
23 def __init__(self, name):
\r
26 def run(self, hooke_frame, msg):
\r
27 raise NotImplemented
\r
29 def _cancel(self, *args, **kwargs):
\r
30 # TODO: somehow abort the running command
\r
33 HANDLERS = construct_odict(
\r
34 this_modname=__name__,
\r
35 submodnames=USER_INTERFACE_MODULES,
\r
36 class_selector=IsSubclass(UserInterface, blacklist=[UserInterface]))
\r
37 """:class:`hooke.compat.odict.odict` of :class:`Handler`
\r
38 instances keyed by `.name`.
\r