Added gui.panel.output for displaying text output
[hooke.git] / hooke / ui / gui / panel / __init__.py
1 # Copyright\r
2 \r
3 from ....util.pluggable import IsSubclass, construct_odict\r
4 \r
5 \r
6 PANEL_MODULES = [\r
7     'commands',\r
8 #    'note',\r
9 #    'notebook',\r
10     'output',\r
11 #    'playlist',\r
12 #    'plot',\r
13 #    'propertyeditor',\r
14 #    'results',\r
15 #    'selection',\r
16 #    'welcome',\r
17     ]\r
18 """List of panel modules.  TODO: autodiscovery\r
19 """\r
20 \r
21 class Panel (object):\r
22     """Base class for Hooke GUI panels.\r
23     \r
24     :attr:`name` identifies the request type and should match the\r
25     module name.\r
26     """\r
27     def __init__(self, name=None, callbacks=None, **kwargs):\r
28         super(Panel, self).__init__(**kwargs)\r
29         self.name = name\r
30         if callbacks == None:\r
31             callbacks = {}\r
32         self._callbacks = callbacks\r
33 \r
34 \r
35 PANELS = construct_odict(\r
36     this_modname=__name__,\r
37     submodnames=PANEL_MODULES,\r
38     class_selector=IsSubclass(Panel, blacklist=[Panel]),\r
39     instantiate=False)\r
40 """:class:`hooke.compat.odict.odict` of :class:`Panel`\r
41 instances keyed by `.name`.\r
42 """\r