Improve the validation process, showing the results
[bertos.git] / wizard / bertos_utils.py
index a946d970890ec74779556a3f580ee070f90182c2..ed66a3b80d3e67ee2067dda814aa997624909d05 100644 (file)
@@ -44,13 +44,21 @@ def findToolchains(pathList):
 def getToolchainInfo(output):
     info = {}
     expr = re.compile("Target: .*")
-    info["target"] = expr.findall(output)[0].split("Target: ")[1]
+    target = expr.findall(output)
+    if len(target) == 1:
+        info["target"] = target[0].split("Target: ")[1]
     expr = re.compile("gcc version .*")
-    info["version"] = expr.findall(output)[0].split("gcc version ")[1]
+    version = expr.findall(output)
+    if len(version) == 1:
+        info["version"] = version[0].split("gcc version ")[1]
     expr = re.compile("Configured with: .*")
-    info["configured"] = expr.findall(output)[0].split("Configured with: ")[1]
+    configured = expr.findall(output)
+    if len(configured) == 1:
+        info["configured"] = configured[0].split("Configured with: ")[1]
     expr = re.compile("Thread model: .*")
-    info["thread"] = expr.findall(output)[0].split("Thread model: ")[1]
+    thread = expr.findall(output)
+    if len(thread) == 1:
+        info["thread"] = thread[0].split("Thread model: ")[1]
     return info
 
 def findDefinitions(ftype, path):