Can successfully run 'load playlist' from CommandsPanel
[hooke.git] / hooke / ui / gui / panel / propertyeditor2.py
index 4efe18235832352a053604eb1bde44c43795fb6a..0bf04a3e04a60ba49b83a37713fa7cdce19a00ab 100644 (file)
@@ -20,21 +20,25 @@ from . import Panel
 def prop_from_argument(argument, curves=None, playlists=None):\r
     """Convert a :class:`~hooke.command.Argument` to a :class:`Property`.\r
     """\r
+    type = argument.type\r
+    if type in ['driver']:  # intentionally not handled (yet)\r
+        return None\r
     if argument.count != 1:\r
         raise NotImplementedError(argument)\r
     kwargs = {\r
         'label':argument.name,\r
         'default':argument.default,\r
-        'help':argument.help,\r
+        'help':argument.help(),\r
         }\r
-    type = argument.type\r
+    # type consolidation\r
     if type == 'file':\r
         type = 'path'\r
-    if argument.type in ['string', 'bool', 'int', 'float', 'path']:\r
+    # type handling\r
+    if type in ['string', 'bool', 'int', 'float', 'path']:\r
         _class = globals()['%sProperty' % type.capitalize()]\r
         return _class(**kwargs)\r
-    elif argument.type in ['curve', 'playlist']:\r
-        if argument.type == 'curve':\r
+    elif type in ['curve', 'playlist']:\r
+        if type == 'curve':\r
             choices = curves  # extract from a particular playlist?\r
         else:\r
             choices = playlists\r
@@ -245,6 +249,10 @@ class PropertyPanel(Panel, wx.grid.Grid):
         string = self.GetCellValue(row=row, col=0)\r
         return property.value_for_string(string)\r
 \r
+    def get_values(self):\r
+        return dict([(p.label, self.get_property(p.label))\r
+                     for p in self._properties])\r
+\r
     def _property_by_label(self, label):\r
         props = [(i,p) for i,p in enumerate(self._properties)\r
                  if p.label == label]\r