apply_requires: add property if any property raise PropertyError if same_action is False
This commit is contained in:
@ -356,11 +356,16 @@ def apply_requires(opt, config):
|
||||
option, expected, action = require
|
||||
inverse = False
|
||||
transitive = True
|
||||
same_action = True
|
||||
elif len(require) == 4:
|
||||
option, expected, action, inverse = require
|
||||
transitive = True
|
||||
same_action = True
|
||||
elif len(require) == 5:
|
||||
option, expected, action, inverse, transitive = require
|
||||
same_action = True
|
||||
elif len(require) == 6:
|
||||
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 "
|
||||
@ -372,9 +377,9 @@ def apply_requires(opt, config):
|
||||
if not transitive:
|
||||
continue
|
||||
properties = err.proptype
|
||||
if action not in 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), properties)
|
||||
"{1} {2}").format(opt._name, path, properties))
|
||||
#transitive action, force expected
|
||||
value = expected
|
||||
inverse = False
|
||||
|
Reference in New Issue
Block a user