From fc60560eeb0eaefebe7a0ea2a3e551653dc450e4 Mon Sep 17 00:00:00 2001 From: duplo Date: Fri, 23 Apr 2010 14:50:01 +0000 Subject: [PATCH] Add information about project source path. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3508 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/BFolderPage.py | 1 + wizard/BProject.py | 11 +++++++---- wizard/bertos_utils.py | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/wizard/BFolderPage.py b/wizard/BFolderPage.py index 569ebd94..3b3bce89 100644 --- a/wizard/BFolderPage.py +++ b/wizard/BFolderPage.py @@ -65,6 +65,7 @@ class BFolderPage(BWizardPage): if self.pageContent.projectPath.text() != "None": self.setProjectInfo("PROJECT_PATH", unicode(self.pageContent.projectPath.text())) self.setProjectInfo("PROJECT_NAME", os.path.basename(unicode(self.pageContent.projectPath.text()))) + self.setProjectInfo("PROJECT_SRC_PATH", os.path.join(self.projectInfo("PROJECT_PATH"), self.projectInfo("PROJECT_NAME"))) self.setProjectInfo("ROUTE", self.next_page) self.setProjectInfo("PROJECT_FROM_PRESET", self.from_preset) return True diff --git a/wizard/BProject.py b/wizard/BProject.py index 06bdc432..1aee8454 100644 --- a/wizard/BProject.py +++ b/wizard/BProject.py @@ -82,10 +82,13 @@ class BProject(object): # NOTE: this can throw an Exception if the user has changed the directory containing the project self.infos["PROJECT_NAME"] = project_data.get("PROJECT_NAME", os.path.basename(project_dir)) self.infos["PROJECT_PATH"] = os.path.dirname(project_file) + project_src_path = project_data.get("PROJECT_SRC_PATH", None) + if project_src_path: + self.infos["PROJECT_SRC_PATH"] = project_src_path - preset = project_data.get("PRESET", False) - if not preset: - # Ignore the SOURCES_PATH inside the project file if it's not setted as 'preset' + wizard_version = project_data.get("WIZARD_VERSION", 0) + if wizard_version < 1: + # Ignore the SOURCES_PATH inside the project file for older project project_data["SOURCES_PATH"] = project_dir else: linked_sources_path = project_data["SOURCES_PATH"] @@ -94,7 +97,7 @@ class BProject(object): self._loadBertosSourceStuff(project_data["SOURCES_PATH"], info_dict.get("SOURCES_PATH", None)) - self.infos["PRESET"] = preset + self.infos["PRESET"] = project_data.get("PRESET", False) # For those projects that don't have a VERSION file create a dummy one. if not isBertosDir(project_dir): diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index afb76d42..6327fd5e 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -119,6 +119,7 @@ def projectFileGenerator(project_info): # project_data["SOURCES_PATH"] = project_info.info("SOURCES_PATH") project_data["SOURCES_PATH"] = directory project_data["PROJECT_NAME"] = project_info.info("PROJECT_NAME", os.path.basename(directory)) + project_data["PROJECT_SRC_PATH"] = project_info.info("PROJECT_SRC_PATH") project_data["TOOLCHAIN"] = project_info.info("TOOLCHAIN") project_data["CPU_NAME"] = project_info.info("CPU_NAME") project_data["SELECTED_FREQ"] = project_info.info("SELECTED_FREQ") -- 2.25.1