Fix BeRTOS version related bug.
[bertos.git] / wizard / BProject.py
index c8bb4f0e54064d22e29864d3d55b362b03031bfe..76f62217d647ca5a47d979114262b076bdbbe6d2 100644 (file)
@@ -162,7 +162,6 @@ class BProject(object):
         project_data = pickle.loads(open(project_file, "r").read())
         self.loadSourceTree()
         self._loadCpuStuff(project_data["CPU_NAME"], project_data["SELECTED_FREQ"])
-        self._loadToolchainStuff(project_data["TOOLCHAIN"])
 
         # NOTE: this is a HACK!!!
         # TODO: find a better way to reuse loadModuleData
@@ -268,7 +267,7 @@ class BProject(object):
                             try:
                                 path = self.infos["PROJECT_SRC_PATH"]
                                 cfg_file_path = os.path.join(path, configuration)
-                                configuration_info[configuration] = updateConfigurationValues(configuration_info[configuration], cfg_file_path)
+                                configuration_info[configuration] = updateConfigurationValues(configuration_info[configuration], loadConfigurationInfos(cfg_file_path))
                             except ParseError, err:
                                 raise DefineException.ConfigurationDefineException(cfg_file_path, err.line_number, err.line)
                 module_info_dict.update(module_dict)
@@ -402,8 +401,9 @@ class BProject(object):
         self.infos["RELEVANT_FILES"] = relevants_files
 
     def _writeVersionFile(self, filename):
-        version_file = open(os.path.join(const.DATA_DIR, "vtemplates/VERSION"), "r").read()
-        open(filename, "w").write(versionFileGenerator(self, version_file))
+        if not self.edit or self.old_srcdir:
+            version_file = open(os.path.join(const.DATA_DIR, "vtemplates/VERSION"), "r").read()
+            open(filename, "w").write(versionFileGenerator(self, version_file))
 
     def _writeProjectFile(self, filename):
         f = open(filename, "w")