From: duplo Date: Fri, 23 Apr 2010 13:09:34 +0000 (+0000) Subject: Add information for advanced preset editing. X-Git-Tag: 2.5.0~401 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=808573c075de3f0aec6c2190b1d4ac4dd0409fdc;p=bertos.git Add information for advanced preset editing. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3507 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/BProject.py b/wizard/BProject.py index edba9d66..06bdc432 100644 --- a/wizard/BProject.py +++ b/wizard/BProject.py @@ -83,12 +83,18 @@ class BProject(object): self.infos["PROJECT_NAME"] = project_data.get("PROJECT_NAME", os.path.basename(project_dir)) self.infos["PROJECT_PATH"] = os.path.dirname(project_file) - # Check for the Wizard version - wizard_version = project_data.get("WIZARD_VERSION", 0) - if wizard_version < 1: - # Ignore the SOURCES_PATH inside the project file for older projects + preset = project_data.get("PRESET", False) + if not preset: + # Ignore the SOURCES_PATH inside the project file if it's not setted as 'preset' project_data["SOURCES_PATH"] = project_dir + else: + linked_sources_path = project_data["SOURCES_PATH"] + sources_abspath = os.path.abspath(os.path.join(project_dir, linked_sources_path)) + project_data["SOURCES_PATH"] = sources_abspath + self._loadBertosSourceStuff(project_data["SOURCES_PATH"], info_dict.get("SOURCES_PATH", None)) + + self.infos["PRESET"] = preset # 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 3957b674..afb76d42 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -110,9 +110,14 @@ def projectFileGenerator(project_info): if information["enabled"]: enabled_modules.append(module) project_data["ENABLED_MODULES"] = enabled_modules - # Use the local BeRTOS version instead of the original one - # project_data["SOURCES_PATH"] = project_info.info("SOURCES_PATH") - project_data["SOURCES_PATH"] = directory + if project_info.info("PRESET"): + # For presets save again the SOURCES_PATH into project file + project_data["PRESET"] = True + project_data["SOURCES_PATH"] = project_info.info("SOURCES_PATH") + else: + # Use the local BeRTOS version instead of the original one + # 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["TOOLCHAIN"] = project_info.info("TOOLCHAIN") project_data["CPU_NAME"] = project_info.info("CPU_NAME")