From de47772958bf82911516717b34ee9fce20e628fb Mon Sep 17 00:00:00 2001 From: gwen Date: Thu, 29 Nov 2012 10:15:30 +0100 Subject: [PATCH] string representation for a symlink option --- tiramisu/config.py | 5 +++-- tiramisu/option.py | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tiramisu/config.py b/tiramisu/config.py index 1170e64..a24e10a 100644 --- a/tiramisu/config.py +++ b/tiramisu/config.py @@ -176,7 +176,8 @@ class Config(object): opt_or_descr = getattr(self._cfgimpl_descr, name) # symlink options if type(opt_or_descr) == SymLinkOption: - return getattr(self, opt_or_descr.path) + rootconfig = self._cfgimpl_get_toplevel() + return getattr(rootconfig, opt_or_descr.path) if name not in self._cfgimpl_values: raise AttributeError("%s object has no attribute %s" % (self.__class__, name)) @@ -384,7 +385,7 @@ class Config(object): """Pythonesque way of parsing group's ordered options. iteration only on Options (not OptionDescriptions)""" for child in self._cfgimpl_descr._children: - if isinstance(child, Option): + if not isinstance(child, OptionDescription): try: yield child._name, getattr(self, child._name) except: diff --git a/tiramisu/option.py b/tiramisu/option.py index 642dc7e..1a242b9 100644 --- a/tiramisu/option.py +++ b/tiramisu/option.py @@ -326,6 +326,11 @@ class ChoiceOption(Option): requires=None, mandatory=False, multi=False, callback=None, callback_params=None, open_values=False, validator=None, validator_args={}): + """ + :default: default non multi option's value + :default_multi: default value in case of a multi + :param open_values: allowed values for the option's value + """ self.values = values if open_values not in [True, False]: raise ConfigError('Open_values must be a boolean for '