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
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