From e86d751b965729dc14510d4ac55a507837f90584 Mon Sep 17 00:00:00 2001 From: duplo Date: Tue, 20 Apr 2010 13:49:02 +0000 Subject: [PATCH] Add setEnabledModules as method of BProject class (instead of function). git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3479 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/BProject.py | 18 +++++++++++++++--- wizard/bertos_utils.py | 12 ------------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/wizard/BProject.py b/wizard/BProject.py index d01e9189..6336bbf5 100644 --- a/wizard/BProject.py +++ b/wizard/BProject.py @@ -46,9 +46,9 @@ import const from bertos_utils import ( # Utility functions - isBertosDir, getTagSet, setEnabledModules, getInfos, + isBertosDir, getTagSet, getInfos, updateConfigurationValues, loadConfigurationInfos, loadDefineLists, loadModuleDefinition, - getCommentList, updateConfigurationValues, + getCommentList, # Custom exceptions ParseError, SupportedException @@ -92,7 +92,7 @@ class BProject(object): self.loadToolchainStuff(project_data, info_dict.get("TOOLCHAIN", None)) self.infos["OUTPUT"] = project_data["OUTPUT"] self.loadModuleData(True) - setEnabledModules(self, project_data["ENABLED_MODULES"]) + self.setEnabledModules(project_data["ENABLED_MODULES"]) def loadBertosSourceStuff(self, project_data, forced_version=None): bertos_source_path = project_data["SOURCES_PATH"] @@ -290,5 +290,17 @@ class BProject(object): self._cached_queries[self.infos["SOURCES_PATH"]][ftype] = definitions return definitions + def setEnabledModules(self, enabled_modules): + modules = self.infos["MODULES"] + files = {} + for module, information in modules.items(): + information["enabled"] = module in enabled_modules + if information["enabled"]: + for dependency in information["depends"]: + if not dependency in modules: + files[dependency] = files.get(dependency, 0) + 1 + self.infos["MODULES"] = modules + self.infos["FILES"] = files + def __repr__(self): return repr(self.infos) diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index fcd329ff..ed9a0db2 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -56,18 +56,6 @@ def isBertosDir(directory): def bertosVersion(directory): return open(directory + "/VERSION").readline().strip() -def setEnabledModules(project_info, enabled_modules): - modules = project_info.info("MODULES") - files = {} - for module, information in modules.items(): - information["enabled"] = module in enabled_modules - if information["enabled"]: - for dependency in information["depends"]: - if not dependency in modules: - files[dependency] = files.get(dependency, 0) + 1 - project_info.setInfo("MODULES", modules) - project_info.setInfo("FILES", files) - def enabledModules(project_info): enabled_modules = [] for name, module in project_info.info("MODULES").items(): -- 2.25.1