pep 8 lines too long
This commit is contained in:
@ -28,7 +28,8 @@ from tiramisu.i18n import _
|
||||
default_encoding = 'utf-8'
|
||||
expires_time = 5
|
||||
ro_remove = ('permissive', 'hidden')
|
||||
ro_append = ('frozen', 'disabled', 'validator', 'everything_frozen', 'mandatory')
|
||||
ro_append = ('frozen', 'disabled', 'validator', 'everything_frozen',
|
||||
'mandatory')
|
||||
rw_remove = ('permissive', 'everything_frozen', 'mandatory')
|
||||
rw_append = ('frozen', 'disabled', 'validator', 'hidden')
|
||||
default_properties = ('expire', 'validator')
|
||||
@ -280,7 +281,7 @@ class Setting(object):
|
||||
properties -= frozenset(('mandatory', 'frozen'))
|
||||
else:
|
||||
if 'mandatory' in properties and \
|
||||
not self.context.cfgimpl_get_values()._is_empty(opt_or_descr,
|
||||
not self.context.cfgimpl_get_values()._is_empty(opt_or_descr,
|
||||
value):
|
||||
properties.remove('mandatory')
|
||||
if is_write and 'everything_frozen' in self_properties:
|
||||
@ -292,12 +293,15 @@ class Setting(object):
|
||||
props = list(properties)
|
||||
if 'frozen' in properties:
|
||||
raise PropertiesOptionError(_('cannot change the value for '
|
||||
'option {0} this option is frozen'
|
||||
'').format(opt_or_descr._name), props)
|
||||
'option {0} this option is'
|
||||
' frozen').format(
|
||||
opt_or_descr._name),
|
||||
props)
|
||||
else:
|
||||
raise PropertiesOptionError(_("trying to access to an option "
|
||||
"named: {0} with properties {1}"
|
||||
"").format(opt_or_descr._name, str(props)), props)
|
||||
"").format(opt_or_descr._name,
|
||||
str(props)), props)
|
||||
|
||||
def _get_permissive(self, opt=None):
|
||||
return self._permissives.get(opt, frozenset())
|
||||
@ -361,12 +365,13 @@ class Setting(object):
|
||||
for requires in opt._requires:
|
||||
matches = False
|
||||
for require in requires:
|
||||
option, expected, action, inverse, transitive, same_action = require
|
||||
option, expected, action, inverse, \
|
||||
transitive, same_action = require
|
||||
path = descr.impl_get_path_by_opt(option)
|
||||
if path == optpath or path.startswith(optpath + '.'):
|
||||
raise RequirementError(_("malformed requirements "
|
||||
"imbrication detected for option: '{0}' "
|
||||
"with requirement on: '{1}'").format(optpath, path))
|
||||
"imbrication detected for option: '{0}' "
|
||||
"with requirement on: '{1}'").format(optpath, path))
|
||||
try:
|
||||
value = self.context._getattr(path, force_permissive=True)
|
||||
except PropertiesOptionError, err:
|
||||
@ -374,15 +379,21 @@ class Setting(object):
|
||||
continue
|
||||
properties = err.proptype
|
||||
if same_action and action not in properties:
|
||||
raise RequirementError(_("option '{0}' has requirement's property error: "
|
||||
"{1} {2}").format(opt._name, path, properties))
|
||||
raise RequirementError(_("option '{0}' has "
|
||||
"requirement's property "
|
||||
"error: "
|
||||
"{1} {2}").format(opt._name,
|
||||
path,
|
||||
properties))
|
||||
#transitive action, force expected
|
||||
value = expected[0]
|
||||
inverse = False
|
||||
except AttributeError:
|
||||
raise AttributeError(_("required option not found: "
|
||||
"{0}").format(path))
|
||||
if not inverse and value in expected or inverse and value not in expected:
|
||||
if (not inverse and
|
||||
value in expected or
|
||||
inverse and value not in expected):
|
||||
matches = True
|
||||
setting.append(action)
|
||||
## the calculation cannot be carried out
|
||||
|
Reference in New Issue
Block a user