Correct a little bug about empty configurations
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 26 Mar 2009 09:32:38 +0000 (09:32 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 26 Mar 2009 09:32:38 +0000 (09:32 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2435 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BCreationPage.py
wizard/bertos_utils.py

index 3f9748445066c037a3f857b36ab450724e32889d..892f9e8241573d866923754292e7c99a3894fe07 100644 (file)
@@ -71,12 +71,12 @@ class BCreationPage(BWizardPage):
                 moduleItem = QTreeWidgetItem(QStringList([module + " - " + information["description"]]))
                 module_categories[information["category"]].append(moduleItem)
                 if len(information["configuration"]) > 0:
-                    for property, data in configurations[information["configuration"]].items():
+                    for start, property in configurations[information["configuration"]]["paramlist"]:
                         # If the final char of the brief is a dot (".") removes it.
-                        brief = data["brief"]
+                        brief = configurations[information["configuration"]][property]["brief"]
                         if brief[-1] == ".":
                             brief = brief[:-1]
-                        configuration_item = QTreeWidgetItem(moduleItem, QStringList([brief + ": " + data["value"]]))
+                        configuration_item = QTreeWidgetItem(moduleItem, QStringList([brief + ": " + configurations[information["configuration"]][property]["value"]]))
         for key, value in module_categories.items():
             category_item = QTreeWidgetItem(module_title, QStringList([key]))
             category_item.addChildren(value)
index ecc8e1329bb136937f46a9e5eebb492afb7b7a1b..4a17beb91eb209ab914dab8e96356b4a395adb11 100644 (file)
@@ -52,9 +52,10 @@ def createBertosProject(project_info):
     cfgdir = prjdir + "/cfg"
     shutil.rmtree(cfgdir, True)
     os.mkdir(cfgdir)
-    for key, value in project_info.info("CONFIGURATIONS").items():
-        string = open(sources_dir + "/" + key, "r").read()
-        for parameter, infos in value.items():
+    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"
@@ -63,7 +64,7 @@ def createBertosProject(project_info):
             if "long" in infos["informations"].keys() and infos["informations"]["long"]:
                 value += "L"
             string = sub(string, parameter, value)
-        f = open(cfgdir + "/" + os.path.basename(key), "w")
+        f = open(cfgdir + "/" + os.path.basename(configuration), "w")
         f.write(string)
         f.close()
     ## Destinatio mk file