X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=wizard%2Fbertos_utils.py;h=99bdca23f7b248463f1dcd42452795736b4f1871;hb=958626ece926cf0b9b30993aef5dea88fb70dc32;hp=b927ec48e1e46906c77b730a0f2e7f5fafef638d;hpb=0676a7451f0fd727af3c17350f6abbde825b4e3b;p=bertos.git diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index b927ec48..99bdca23 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -12,6 +12,8 @@ import os import fnmatch +import const + def isBertosDir(directory): return os.path.exists(directory + "/VERSION") @@ -27,16 +29,18 @@ def findDefinitions(ftype, path): L = os.walk(path) for element in L: for filename in element[2]: - if fnmatch.fnmatch(filename, "*." + ftype): + if fnmatch.fnmatch(filename, ftype): yield (filename, element[0]) def loadCpuInfos(path): cpuInfos = [] - for definition in findDefinitions("cdef", path): + for definition in findDefinitions(const.CPU_DEFINITION, path): D = {} + D.update(const.CPU_DEF) def include(filename, dict = D, directory=definition[1]): execfile(directory + "/" + filename, {}, D) D["include"] = include include(definition[0], D) + D["CPU_NAME"] = definition[0].split(".")[0] cpuInfos.append(D) return cpuInfos