Can successfully run 'load playlist' from CommandsPanel
[hooke.git] / hooke / ui / gui / __init__.py
index 85c73e7fd5a57921d814b2dcbacc7d0e0bd2222c..48bf62d8517967f14e69a3284f23752b2a7d08d1 100644 (file)
@@ -265,6 +265,15 @@ class HookeFrame (wx.Frame):
 \r
     def execute_command(self, _class=None, method=None,\r
                         command=None, args=None):\r
+        if args == None:\r
+            args = {}\r
+        if ('property' in self._c\r
+            and self.gui.config['selected command'] == command):\r
+            arg_names = [arg.name for arg in command.arguments]\r
+            for name,value in self._c['property'].get_values().items():\r
+                if name in arg_names:\r
+                    args[name] = value\r
+        print 'executing', command.name, args\r
         self.inqueue.put(CommandMessage(command, args))\r
         results = []\r
         while True:\r
@@ -665,8 +674,12 @@ class HookeFrame (wx.Frame):
         for argument in command.arguments:\r
             if argument.name == 'help':\r
                 continue\r
-            self._c['property'].append_property(prop_from_argument(\r
-                    argument, curves=[], playlists=[]))  # TODO: lookup playlists/curves\r
+            p = prop_from_argument(\r
+                argument, curves=[], playlists=[])  # TODO: lookup playlists/curves\r
+            if p == None:\r
+                continue  # property intentionally not handled (yet)\r
+            self._c['property'].append_property(p)\r
+\r
         self.gui.config['selected command'] = command  # TODO: push to engine\r
 \r
 \r