-def loadModuleData(project):
- moduleInfoDict = {}
- listInfoDict = {}
- configurationInfoDict = {}
- fileDict = {}
- for filename, path in findDefinitions("*.h", project):
- commentList = getCommentList(open(path + "/" + filename, "r").read())
- if len(commentList) > 0:
- moduleInfo = {}
- configurationInfo = {}
- try:
- toBeParsed, moduleDict = loadModuleDefinition(commentList[0])
- except ParseError, err:
- raise DefineException.ModuleDefineException(path, err.line_number, err.line)
- for module, information in moduleDict.items():
- information["category"] = os.path.basename(path)
- if "configuration" in information.keys() and len(information["configuration"]):
- configuration = moduleDict[module]["configuration"]
- try:
- configurationInfo[configuration] = loadConfigurationInfos(project.info("SOURCES_PATH") + "/" + configuration)
- except ParseError, err:
- raise DefineException.ConfigurationDefineException(project.info("SOURCES_PATH") + "/" + configuration, err.line_number, err.line)
- moduleInfoDict.update(moduleDict)
- configurationInfoDict.update(configurationInfo)
- if toBeParsed:
- try:
- listDict = loadDefineLists(commentList[1:])
- listInfoDict.update(listDict)
- except ParseError, err:
- raise DefineException.EnumDefineException(path, err.line_number, err.line)
- for filename, path in findDefinitions("*_" + project.info("CPU_INFOS")["TOOLCHAIN"] + ".h", project):
- commentList = getCommentList(open(path + "/" + filename, "r").read())
- listInfoDict.update(loadDefineLists(commentList))
- for tag in project.info("CPU_INFOS")["CPU_TAGS"]:
- for filename, path in findDefinitions("*_" + tag + ".h", project):
- commentList = getCommentList(open(path + "/" + filename, "r").read())
- listInfoDict.update(loadDefineLists(commentList))
- project.setInfo("MODULES", moduleInfoDict)
- project.setInfo("LISTS", listInfoDict)
- project.setInfo("CONFIGURATIONS", configurationInfoDict)
- project.setInfo("FILES", fileDict)
-