def _populateCpuList(self):
self.pageContent.cpuList.clear()
self.pageContent.cpuList.setCurrentItem(None)
- infos = bertos_utils.loadCpuInfos(self._projectInfoRetrieve("SOURCES_PATH"))
+ infos = bertos_utils.loadCpuInfos(self._project())
for cpu in infos:
item = QListWidgetItem(cpu["CPU_NAME"])
item.setData(Qt.UserRole, qvariant_converter.convertDict(cpu))
def _loadModuleData(self):
try:
- modules = bertos_utils.loadModuleInfosDict(self._projectInfoRetrieve("SOURCES_PATH"))
- lists = bertos_utils.loadDefineListsDict(self._projectInfoRetrieve("SOURCES_PATH"))
+ modules = bertos_utils.loadModuleInfosDict(self._project())
+ lists = bertos_utils.loadDefineListsDict(self._project())
configurations = {}
for module, informations in modules.items():
if len(informations["configuration"]) > 0:
info["thread"] = thread[0].split("Thread model: ")[1]
return info
-def findDefinitions(ftype, path):
- L = os.walk(path)
+def findDefinitions(ftype, project):
+ L = project.info("FILE_LIST")
+ if L is None:
+ L = [f for f in os.walk(project.info("SOURCES_PATH"))]
+ project.setInfo("FILE_LIST", L)
+ definitions = []
for element in L:
for filename in element[2]:
if fnmatch.fnmatch(filename, ftype):
- yield (filename, element[0])
+ definitions.append((filename, element[0]))
+ return definitions
-def loadCpuInfos(path):
+def loadCpuInfos(project):
cpuInfos = []
- for definition in findDefinitions(const.CPU_DEFINITION, path):
+ for definition in findDefinitions(const.CPU_DEFINITION, project):
cpuInfos.append(getInfos(definition))
return cpuInfos
except SyntaxError:
raise DefineException.ModuleDefineException(path)
-def loadModuleInfosDict(path):
+def loadModuleInfosDict(project):
"""
Return the dict containig all the modules
"""
moduleInfosDict = {}
- for filename, path in findDefinitions("*.h", path):
+ for filename, path in findDefinitions("*.h", project):
moduleInfosDict.update(loadModuleInfos(path + "/" + filename))
return moduleInfosDict
except SyntaxError:
raise DefineException.EnumDefineException(path)
-def loadDefineListsDict(path):
+def loadDefineListsDict(project):
"""
Return the dict containing all the define lists
"""
defineListsDict = {}
- for filename, path in findDefinitions("*.h", path):
+ for filename, path in findDefinitions("*.h", project):
defineListsDict.update(loadDefineLists(path + "/" + filename))
return defineListsDict