This commit is contained in:
gwen 2013-02-26 14:31:45 +01:00
parent 8be48e5eba
commit 762b0e9c69

View File

@ -80,12 +80,27 @@ class Values(object):
"convenience method to know if an option is empty"
if value is not None:
return False
if (not opt.is_multi() and self._get_value(opt) == None) or \
(opt.is_multi() and (self._get_value(opt) == [] or \
if (not opt.is_multi() and value == None) or \
(opt.is_multi() and (value == [] or \
None in self._get_value(opt))):
return True
return False
def is_empty(self, opt):
if opt not in self.values:
return True
value = self.values[opt]
if not opt.is_multi():
if self._get_value(opt) == None:
return True
return False
else:
value = list(value)
for val in value:
if val != None:
return False
return True
def _test_mandatory(self, opt, value=None):
# mandatory options
mandatory = self.context._cfgimpl_settings.mandatory