support multi requires with inverse set to True

This commit is contained in:
2013-06-28 11:59:51 +02:00
parent 75f7e7ce5d
commit e501c6d12d
2 changed files with 97 additions and 3 deletions

View File

@ -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: