Started converting GUI to new UserInterface architecture
authorW. Trevor King <wking@drexel.edu>
Fri, 18 Jun 2010 13:10:34 +0000 (09:10 -0400)
committerW. Trevor King <wking@drexel.edu>
Fri, 18 Jun 2010 13:10:34 +0000 (09:10 -0400)
hooke/ui/gui/__init__.py

index 803f29c904c2b32c2b0b67a99d33095ed340a97f..310902f305d03505656db3c4f033e17a78e5cb84 100644 (file)
@@ -1 +1,39 @@
-#!/usr/bin/env python\r
+# Copyright\r
+\r
+"""Defines :class:`GUI` providing a wxWindows interface to Hooke.\r
+"""\r
+\r
+from ..command import CommandExit, Exit, Command, Argument, StoreValue\r
+from ..interaction import Request, BooleanRequest, ReloadUserInterfaceConfig\r
+from ..ui import UserInterface, CommandMessage\r
+from ..util.encoding import get_input_encoding, get_output_encoding\r
+\r
+\r
+class GUI (UserInterface):\r
+    """wxWindows graphical user interface.\r
+    """\r
+    def __init__(self):\r
+        super(GUI, self).__init__(name='gui')\r
+\r
+    def default_settings(self):\r
+        """Return a list of :class:`hooke.config.Setting`\s for any\r
+        configurable UI settings.\r
+\r
+        The suggested section setting is::\r
+\r
+            Setting(section=self.setting_section, help=self.__doc__)\r
+        """\r
+        return []\r
+\r
+    def reload_config(self):\r
+        pass\r
+\r
+    def run(self, commands, ui_to_command_queue, command_to_ui_queue):\r
+        self._initialize()\r
+        cmd = self._cmd(commands, ui_to_command_queue, command_to_ui_queue)\r
+        cmd.cmdloop(self._splash_text())\r
+\r
+    def run_lines(self, commands, ui_to_command_queue, command_to_ui_queue,\r
+                  lines):\r
+        raise NotImplementedError(\r
+            'Use the command line interface for run_lines()')\r