Fix naming convention issue (related to HW_DIR/HW_PATH/PROJECT_HW_PATH...)
authorbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 30 Apr 2010 10:14:33 +0000 (10:14 +0000)
committerbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 30 Apr 2010 10:14:33 +0000 (10:14 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3574 38d2e660-2303-0410-9eaa-f027e97ec537

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

index eaa5d02f11b4eb94ed57c7bf7d552bc2fb85861d..50cb2cd6b38db3de9c6d38a6bc2e4ccbc483342b 100644 (file)
@@ -66,7 +66,7 @@ class BFolderPage(BWizardPage):
             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("HW_PATH", os.path.join(self.projectInfo("PROJECT_PATH"), self.projectInfo("PROJECT_NAME")))
+            self.setProjectInfo("PROJECT_HW_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 798a96a9539c2a27eadbdf6de91df59f3840eef4..adf78febaca716f03cba94fd5b84bb4893a485a8 100644 (file)
@@ -93,7 +93,7 @@ class BProject(object):
         else:
             # In projects created with older versions of the Wizard this metadata doesn't exist
             self.infos["PROJECT_SRC_PATH"] = os.path.join(self.infos["PROJECT_PATH"], self.infos["PROJECT_NAME"])
-        self.infos["HW_PATH"] = os.path.join(self.infos["PROJECT_PATH"], project_data.get("HW_PATH", self.infos["PROJECT_PATH"]))
+        self.infos["PROJECT_HW_PATH"] = os.path.join(self.infos["PROJECT_PATH"], project_data.get("PROJECT_HW_PATH", self.infos["PROJECT_PATH"]))
 
         linked_sources_path = project_data["BERTOS_PATH"]
         sources_abspath = os.path.abspath(os.path.join(project_dir, linked_sources_path))
@@ -168,15 +168,17 @@ class BProject(object):
         # TODO: find a better way to reuse loadModuleData
         preset_project_name = project_data.get("PROJECT_NAME", os.path.basename(preset))
         preset_prj_src_path = os.path.join(preset, project_data.get("PROJECT_SRC_PATH", os.path.join(preset, preset_project_name)))
-        preset_hw_path = os.path.join(preset, project_data.get("PROJET_HW_DIR", preset))
+        preset_prj_hw_path = os.path.join(preset, project_data.get("PROJECT_HW_PATH", preset))
 
         old_project_name = self.infos["PROJECT_NAME"]
         old_project_path = self.infos["PROJECT_PATH"]
         old_project_src_path = self.infos["PROJECT_SRC_PATH"]
+        old_project_hw_path = self.infos["PROJECT_HW_PATH"]
 
         self.infos["PROJECT_NAME"] = preset_project_name
         self.infos["PROJECT_PATH"] = preset
         self.infos["PROJECT_SRC_PATH"] = preset_prj_src_path
+        self.infos["PROJECT_HW_PATH"] = preset_prj_hw_path
 
         self.loadModuleData(True)
         self.setEnabledModules(project_data["ENABLED_MODULES"])
@@ -184,12 +186,13 @@ class BProject(object):
         self.infos["PROJECT_NAME"] = old_project_name
         self.infos["PROJECT_PATH"] = old_project_path
         self.infos["PROJECT_SRC_PATH"] = old_project_src_path
+        self.infos["PROJECT_HW_PATH"] = old_project_hw_path
         # End of the ugly HACK!
 
         self.infos["PRESET_NAME"] = preset_project_name
         self.infos["PRESET_PATH"] = preset
         self.infos["PRESET_SRC_PATH"] = preset_prj_src_path
-        self.infos["PRESET_HW_DIR"] = preset_hw_path
+        self.infos["PRESET_HW_PATH"] = preset_prj_hw_path
 
     def loadProjectPresets(self):
         """
@@ -509,7 +512,7 @@ class BProject(object):
     @property
     def src_hwdir(self):
         if self.from_preset:
-            return os.path.join(self.infos["PRESET_PATH"], self.infos["PRESET_HW_DIR"])
+            return os.path.join(self.infos["PRESET_PATH"], self.infos["PRESET_HW_PATH"])
         else:
             return self.sources_dir
 
index f5be4429225d0298294b5a22469cc8bce5dd3863..f3df83d187811530bf06ea4059dd38bf0b465216 100644 (file)
@@ -128,7 +128,7 @@ def projectFileGenerator(project_info):
     project_data["OUTPUT"] = project_info.info("OUTPUT")
     project_data["WIZARD_VERSION"] = WIZARD_VERSION
     project_data["PRESET"] = project_info.info("PRESET")
-    project_data["HW_PATH"] = relpath.relpath(project_info.info("HW_PATH"), directory)
+    project_data["PROJECT_HW_PATH"] = relpath.relpath(project_info.info("PROJECT_HW_PATH"), directory)
     return pickle.dumps(project_data)
 
 def loadPlugin(plugin):
@@ -183,7 +183,7 @@ def mkGenerator(project_info):
     mk_data["$csrc"], mk_data["$pcsrc"], mk_data["$cppasrc"], mk_data["$cxxsrc"], mk_data["$asrc"], mk_data["$constants"] = csrcGenerator(project_info)
     mk_data["$prefix"] = replaceSeparators(project_info.info("TOOLCHAIN")["path"].split("gcc")[0])
     mk_data["$suffix"] = replaceSeparators(project_info.info("TOOLCHAIN")["path"].split("gcc")[1])
-    mk_data["$hwpath"] = relpath.relpath(project_info.info("HW_PATH"), project_info.info("PROJECT_PATH"))
+    mk_data["$hwpath"] = relpath.relpath(project_info.info("PROJECT_HW_PATH"), project_info.info("PROJECT_PATH"))
     for key in mk_data:
         makefile = makefile.replace(key, mk_data[key])
     open(destination, "w").write(makefile)