Extract the validateToolchain function from the BToolchainPage in order to use it...
[bertos.git] / wizard / bertos_utils.py
index fff47c6c5a59d2cb93f3fc3836676d3f2e4a7e61..b57801a0fe6ef6db2658d510cc071d941ad35adb 100644 (file)
@@ -58,6 +58,7 @@ def loadBertosProject(project_file):
     project_info = BProject.BProject()
     project_info.setInfo("PROJECT_PATH", os.path.dirname(project_file))
     project_info.setInfo("SOURCES_PATH", project_data["SOURCES_PATH"])
+    project_info.setInfo("TOOLCHAIN", project_data["TOOLCHAIN"])
     loadSourceTree(project_info)
     cpu_name = project_data["CPU_NAME"]
     project_info.setInfo("CPU_NAME", cpu_name)
@@ -66,6 +67,18 @@ def loadBertosProject(project_file):
         if cpu["CPU_NAME"] == cpu_name:
             project_info.setInfo("CPU_INFOS", cpu)
             break
+    tag_list = getTagSet(cpu_info)
+    # Create, fill and store the dict with the tags
+    tag_dict = {}
+    for element in tag_list:
+        tag_dict[element] = False
+    infos = project_info.info("CPU_INFOS")
+    for tag in tag_dict:
+        if tag in infos["CPU_TAGS"] + [infos["CPU_NAME"], infos["CORE_CPU"], infos["TOOLCHAIN"]]:
+            tag_dict[tag] = True
+        else:
+            tag_dict[tag] = False
+    project_info.setInfo("ALL_CPU_TAGS", tag_dict)
     loadModuleData(project_info, True)
     return project_info
 
@@ -345,6 +358,10 @@ def getToolchainInfo(output):
         info["thread"] = thread[0].split("Thread model: ")[1]
     return info
 
+def getToolchainName(toolchain_info):
+    name = "GCC " + toolchain_info["version"] + " - " + toolchain_info["target"].strip()
+    return name
+
 def loadSourceTree(project):
     fileList = [f for f in os.walk(project.info("SOURCES_PATH"))]
     project.setInfo("FILE_LIST", fileList)