Add setEnabledModules as method of BProject class (instead of function).
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 20 Apr 2010 13:49:02 +0000 (13:49 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 20 Apr 2010 13:49:02 +0000 (13:49 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3479 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BProject.py
wizard/bertos_utils.py

index d01e9189b3f9431671cdd57942fff5ab1a3e1855..6336bbf5ca8b0a932687abb5fc053686cc9e03c6 100644 (file)
@@ -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)
index fcd329ff22984c90ac3bef97f5b19f6ecfddbfb5..ed9a0db27bf57b3ee7ea30cfc6b7838d8a5df04c 100644 (file)
@@ -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():