From: duplo Date: Fri, 2 Jan 2009 15:51:10 +0000 (+0000) Subject: Add the getToolchainInfo function that return a dict with all the information found... X-Git-Tag: 2.1.0~552 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;ds=sidebyside;h=12de616c2f8e438b921c45d2d16b0197e2da7b99;p=bertos.git Add the getToolchainInfo function that return a dict with all the information found in the given toolchain description git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2130 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index 4af4947a..a946d970 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -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: