Enable autoenabled parameters only for enabled modules
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 14 Apr 2009 09:43:28 +0000 (09:43 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 14 Apr 2009 09:43:28 +0000 (09:43 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2496 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/bertos_utils.py

index 5d3edd6900b8ea1aabdf1b34fae233649bb1568d..8b6c90724269d4aa77e62b05242cca532c52c9cc 100644 (file)
@@ -53,13 +53,21 @@ def createBertosProject(project_info):
     cfgdir = prjdir + "/cfg"
     shutil.rmtree(cfgdir, True)
     os.mkdir(cfgdir)
+    # Set to 1 the autoenabled for enabled modules
+    for module, information in project_info.info("MODULES").items():
+        if information["enabled"] and "configuration" in information and information["configuration"] != "":
+            configurations = project_info.info("CONFIGURATIONS")
+            configuration = configurations[information["configuration"]]
+            for start, parameter in configuration["paramlist"]:
+                if "type" in configuration[parameter] and configuration[parameter]["type"] == "autoenabled":
+                    configuration[parameter]["value"] = "1"
+            project_info.setInfo("CONFIGURATIONS", configurations)
+    # Copy all the configuration files
     for configuration, information in project_info.info("CONFIGURATIONS").items():
         string = open(sources_dir + "/" + configuration, "r").read()
         for start, parameter in information["paramlist"]:
             infos = information[parameter]
             value = infos["value"]
-            if "type" in infos["informations"] and infos["informations"]["type"] == "autoenabled":
-                value = "1"
             if "unsigned" in infos["informations"].keys() and infos["informations"]["unsigned"]:
                 value += "U"
             if "long" in infos["informations"].keys() and infos["informations"]["long"]: