getdefault returns the default_multi

This commit is contained in:
gwen 2012-11-29 11:40:52 +01:00
parent de47772958
commit 1dea71c17f

View File

@ -190,9 +190,12 @@ class Option(HiddenBaseType, DisabledBaseType):
return False
return True
def getdefault(self):
def getdefault(self, default_multi=False):
"accessing the default value"
return self.default
if default_multi == False or not self.is_multi():
return self.default
else:
return self.getdefault_multi()
def getdefault_multi(self):
"accessing the default value for a multi"
@ -326,11 +329,6 @@ 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 '