This commit is contained in:
Emmanuel Garette 2013-08-28 09:16:12 +02:00
parent cb7e4b8893
commit 397a600be7

View File

@ -69,7 +69,7 @@ class BaseInformation(object):
except AttributeError:
raise AttributeError(_('{0} has no attribute '
'impl_set_information').format(
self.__class__.__name__))
self.__class__.__name__))
def impl_get_information(self, key, default=None):
"""retrieves one information's item
@ -87,7 +87,7 @@ class BaseInformation(object):
except AttributeError:
raise AttributeError(_('{0} has no attribute '
'impl_get_information').format(
self.__class__.__name__))
self.__class__.__name__))
class Option(BaseInformation):
@ -150,7 +150,7 @@ class Option(BaseInformation):
except ValueError, err:
raise ValueError(_("invalid default_multi value {0} "
"for option {1}: {2}").format(
str(default_multi), name, err))
str(default_multi), name, err))
if callback is not None and (default is not None or
default_multi is not None):
raise ValueError(_("default value not allowed if option: {0} "
@ -180,8 +180,8 @@ class Option(BaseInformation):
if not isinstance(properties, tuple):
raise TypeError(_('invalid properties type {0} for {1},'
' must be a tuple').format(
type(properties),
self._name))
type(properties),
self._name))
self._properties = properties # 'hidden', 'disabled'...
def __eq__(self, other):
@ -329,7 +329,7 @@ class Option(BaseInformation):
"no default value has been set yet"
if ((not self.impl_is_multi() and self._default is None) or
(self.impl_is_multi() and (self._default == []
or None in self._default))):
or None in self._default))):
return True
return False
@ -1003,10 +1003,7 @@ def validate_requires_arg(requires, name):
ret_action = []
for require in opt_requires.values():
req = (require[0], tuple(require[1]),
require[2],
require[3],
require[4],
require[5])
require[2], require[3], require[4], require[5])
ret_action.append(req)
ret.append(tuple(ret_action))
return frozenset(config_action.keys()), tuple(ret)