From c509e4175838e03bd9258d398af731be3a72e060 Mon Sep 17 00:00:00 2001 From: duplo Date: Mon, 26 Apr 2010 14:26:17 +0000 Subject: [PATCH] If the project edited is a preset the wizard doesn't add the following stuff: * VERSION file (it's still copied, I'm investigating...) * Makefile * new sources * hw dir containing the hw files * autogenerated mk file * project files for the IDEs git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3517 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/BProject.py | 38 ++++++++++++++++++++++---------------- wizard/bertos_utils.py | 1 + 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/wizard/BProject.py b/wizard/BProject.py index 310d0602..36fbd5c4 100644 --- a/wizard/BProject.py +++ b/wizard/BProject.py @@ -98,10 +98,9 @@ class BProject(object): elif wizard_version == 1: # Use SOURCES_PATH instead of BERTOS_PATH for backward compatibility project_data["BERTOS_PATH"] = project_data["SOURCES_PATH"] - else: - linked_sources_path = project_data["BERTOS_PATH"] - sources_abspath = os.path.abspath(os.path.join(project_dir, linked_sources_path)) - project_data["BERTOS_PATH"] = sources_abspath + linked_sources_path = project_data["BERTOS_PATH"] + sources_abspath = os.path.abspath(os.path.join(project_dir, linked_sources_path)) + project_data["BERTOS_PATH"] = sources_abspath self._loadBertosSourceStuff(project_data["BERTOS_PATH"], info_dict.get("BERTOS_PATH", None)) @@ -355,22 +354,25 @@ class BProject(object): def _editBertosProject(self): # Write the project file self._writeProjectFile(os.path.join(self.maindir, "project.bertos")) - # VERSION file - self._writeVersionFile(os.path.join(self.maindir, "VERSION")) - # Destination makefile - self._writeMakefile(os.path.join(self.maindir, "Makefile")) - # Merge sources - self._mergeSources(self.sources_dir, self.srcdir, self.old_srcdir) - # Copy all the hw files - self._writeHwFiles(self.sources_dir, self.hwdir) + if not self.is_preset: + # Generate this files only if the project isn't a preset + # VERSION file + self._writeVersionFile(os.path.join(self.maindir, "VERSION")) + # Destination makefile + self._writeMakefile(os.path.join(self.maindir, "Makefile")) + # Merge sources + self._mergeSources(self.sources_dir, self.srcdir, self.old_srcdir) + # Copy all the hw files + self._writeHwFiles(self.sources_dir, self.hwdir) + # Destination wizard mk file + self._writeWizardMkFile(os.path.join(self.prjdir, os.path.basename(self.prjdir) + "_wiz.mk")) # Set properly the autoenabled parameters self._setupAutoenabledParameters() # Copy all the configuration files self._writeCfgFiles(self.sources_dir, self.cfgdir) - # Destination wizard mk file - self._writeWizardMkFile(os.path.join(self.prjdir, os.path.basename(self.prjdir) + "_wiz.mk")) - # Create project files for selected plugins - self._createProjectFiles() + if not self.is_preset: + # Create project files for selected plugins only if the project isn't a preset + self._createProjectFiles() def _createProjectFiles(self): # Files for selected plugins @@ -503,6 +505,10 @@ class BProject(object): def from_preset(self): return self.infos.get("PROJECT_FROM_PRESET", False) + @property + def is_preset(self): + return self.infos.get("PRESET", False) + def _createDirectory(self, directory): if not directory: return diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index d65a39b0..217fe05a 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -125,6 +125,7 @@ def projectFileGenerator(project_info): project_data["SELECTED_FREQ"] = project_info.info("SELECTED_FREQ") project_data["OUTPUT"] = project_info.info("OUTPUT") project_data["WIZARD_VERSION"] = WIZARD_VERSION + project_data["PRESET"] = project_info.info("PRESET") return pickle.dumps(project_data) def loadPlugin(plugin): -- 2.25.1