support multi requires with inverse set to True
[tiramisu.git] / tiramisu / setting.py
index ac50e2e..4604a60 100644 (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: