diff options
Diffstat (limited to 'grc/base/Param.py')
-rw-r--r-- | grc/base/Param.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/grc/base/Param.py b/grc/base/Param.py index 8b8362ac1a..33ba7c3dbb 100644 --- a/grc/base/Param.py +++ b/grc/base/Param.py @@ -68,12 +68,23 @@ class Param(Element): block: the parent element n: the nested odict """ - #grab the data + # if the base key is a valid param key, copy its data and overlay this params data + base_key = n.find('base_key') + if base_key and base_key in block.get_param_keys(): + n_expanded = block.get_param(base_key)._n.copy() + n_expanded.update(n) + n = n_expanded + # save odict in case this param will be base for another + self._n = n + # parse the data self._name = n.find('name') self._key = n.find('key') value = n.find('value') or '' - self._type = n.find('type') + self._type = n.find('type') or 'raw' self._hide = n.find('hide') or '' + self._tab_label = n.find('tab') or block.get_param_tab_labels()[0] + if not self._tab_label in block.get_param_tab_labels(): + block.get_param_tab_labels().append(self._tab_label) #build the param Element.__init__(self, block) #create the Option objects from the n data @@ -143,6 +154,7 @@ class Param(Element): def set_value(self, value): self._value = str(value) #must be a string def get_type(self): return self.get_parent().resolve_dependencies(self._type) + def get_tab_label(self): return self._tab_label def is_enum(self): return self._type == 'enum' def __repr__(self): |