support multi requires with inverse set to True
This commit is contained in:
@ -387,13 +387,25 @@ def apply_requires(opt, config):
|
||||
raise AttributeError(_("required option not found: "
|
||||
"{0}").format(path))
|
||||
if value == expected:
|
||||
matches = True
|
||||
if inverse:
|
||||
#temporary remove, definitive if no value != expected
|
||||
#matches
|
||||
setting.remove(action)
|
||||
else:
|
||||
setting.append(action)
|
||||
## the calculation cannot be carried out
|
||||
break
|
||||
if value != expected:
|
||||
matches = True
|
||||
# the calculation cannot be carried out
|
||||
break
|
||||
if inverse:
|
||||
setting.append(action)
|
||||
# the calculation cannot be carried out
|
||||
break
|
||||
else:
|
||||
#temporary remove, definitive if no value != expected
|
||||
#matches
|
||||
setting.remove(action)
|
||||
# no requirement has been triggered, then just reverse the action
|
||||
if not matches:
|
||||
if inverse:
|
||||
|
Reference in New Issue
Block a user