Add information about project source path.
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 23 Apr 2010 14:50:01 +0000 (14:50 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 23 Apr 2010 14:50:01 +0000 (14:50 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3508 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BFolderPage.py
wizard/BProject.py
wizard/bertos_utils.py

index 569ebd941bde02e1306cde2f5cb4a00847708300..3b3bce8956ba0cc523191dbfcce1dd14ad9711d4 100644 (file)
@@ -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
index 06bdc43272567c83587290874d0fa870e5942780..1aee84549a762aedc3ccea79ef3533e7ba05b826 100644 (file)
@@ -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):
index afb76d426f8e421a33f15c1393cceb08e4af878d..6327fd5ea4478f1154d59b6ecebfb995700ee2a5 100644 (file)
@@ -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")