Add the getToolchainInfo function that return a dict with all the information found...
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 2 Jan 2009 15:51:10 +0000 (15:51 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 2 Jan 2009 15:51:10 +0000 (15:51 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2130 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/bertos_utils.py

index 4af4947a0a735bb02eb2e45eb27065f94167d50e..a946d970890ec74779556a3f580ee070f90182c2 100644 (file)
@@ -12,6 +12,7 @@
 import os
 import fnmatch
 import glob
+import re
 
 import const
 
@@ -40,6 +41,18 @@ def findToolchains(pathList):
         toolchains += glob.glob(element+ "/" + const.GCC_NAME)
     return toolchains
 
+def getToolchainInfo(output):
+    info = {}
+    expr = re.compile("Target: .*")
+    info["target"] = expr.findall(output)[0].split("Target: ")[1]
+    expr = re.compile("gcc version .*")
+    info["version"] = expr.findall(output)[0].split("gcc version ")[1]
+    expr = re.compile("Configured with: .*")
+    info["configured"] = expr.findall(output)[0].split("Configured with: ")[1]
+    expr = re.compile("Thread model: .*")
+    info["thread"] = expr.findall(output)[0].split("Thread model: ")[1]
+    return info
+
 def findDefinitions(ftype, path):
     L = os.walk(path)
     for element in L: