requirements: calculate all requirements for an option
[tiramisu.git] / tiramisu / option.py
index c1c949f..ff50ea2 100644 (file)
@@ -1045,6 +1045,8 @@ def validate_requires_arg(requires, name):
     ret_requires = {}
     config_action = {}
 
+    # start parsing all requires given by user (has dict)
+    # transforme it to a tuple
     for require in requires:
         if not type(require) == dict:
             raise ValueError(_("malformed requirements type for option:"
@@ -1058,6 +1060,7 @@ def validate_requires_arg(requires, name):
                              '{2}'.format(name,
                                           unknown_keys,
                                           valid_keys))
+        # prepare all attributes
         try:
             option = require['option']
             expected = require['expected']
@@ -1106,12 +1109,12 @@ def validate_requires_arg(requires, name):
                                             inverse, transitive, same_action)
         else:
             ret_requires[action][option][1].append(expected)
+    # transform dict to tuple
     ret = []
     for opt_requires in ret_requires.values():
         ret_action = []
         for require in opt_requires.values():
-            req = (require[0], tuple(require[1]), require[2], require[3],
-                   require[4], require[5])
-            ret_action.append(req)
+            ret_action.append((require[0], tuple(require[1]), require[2],
+                               require[3], require[4], require[5]))
         ret.append(tuple(ret_action))
     return frozenset(config_action.keys()), tuple(ret)