From 2c61320249bd075d7ca29c0848f7435e54953d3e Mon Sep 17 00:00:00 2001 From: duplo Date: Fri, 19 Dec 2008 09:28:57 +0000 Subject: [PATCH] Add the self.tr() to the window title git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2097 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/BWizard.py | 2 +- wizard/bertos_utils.py | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/wizard/BWizard.py b/wizard/BWizard.py index b7490667..b543966d 100644 --- a/wizard/BWizard.py +++ b/wizard/BWizard.py @@ -20,7 +20,7 @@ class BWizard(QWizard): def __init__(self): QWizard.__init__(self) - self.setWindowTitle("Create a BeRTOS project") + self.setWindowTitle(self.tr("Create a BeRTOS project")) self._addPages() self._connectSignals() diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index e5a21d9b..fd199632 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -24,10 +24,19 @@ def createBertosProject(directory): open(directory + "/project.bertos", "w") def findDefinitions(ftype, path): - l = os.walk(path) - definitions = {} - for element in l: + L = os.walk(path) + for element in L: for filename in element[2]: if fnmatch.fnmatch(filename, "*." + ftype): - definitions[filename] = element[0] - return definitions \ No newline at end of file + yield (filename, element[0]) + +def loadCpuInfos(path): + cpuInfos = [] + for definition in findDefinitions("cdef", path): + D = {} + def include(filename, dict = D, directory=definition[1]): + execfile(directory + "/" + filename, {}, D) + d["include"] = include + include(definition[0], D) + cpuInfos.append(D) + return cpuInfos -- 2.25.1