From 12de616c2f8e438b921c45d2d16b0197e2da7b99 Mon Sep 17 00:00:00 2001 From: duplo Date: Fri, 2 Jan 2009 15:51:10 +0000 Subject: [PATCH] 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 --- wizard/bertos_utils.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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: -- 2.25.1