From: duplo Date: Tue, 21 Apr 2009 13:17:01 +0000 (+0000) Subject: Change the semantic of the replaceSeparators function X-Git-Tag: 2.1.0~77 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=3475446433a31b89ab480cd19bbdbe8473c3d7fe;p=bertos.git Change the semantic of the replaceSeparators function git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2605 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index bfdcc0ee..2bb749ff 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -115,8 +115,8 @@ def mkGenerator(project_info, makefile): mk_data["$asflags"] = " ".join(project_info.info("CPU_INFOS")["AS_FLAGS"]) mk_data["$arflags"] = " ".join(project_info.info("CPU_INFOS")["AR_FLAGS"]) mk_data["$csrc"], mk_data["$pcsrc"], mk_data["$cppasrc"], mk_data["$cxxsrc"], mk_data["$asrc"], mk_data["$constants"] = csrcGenerator(project_info) - mk_data["$prefix"] = project_info.info("TOOLCHAIN")["path"].split("gcc")[0] - mk_data["$suffix"] = project_info.info("TOOLCHAIN")["path"].split("gcc")[1] + 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["$main"] = os.path.basename(project_info.info("PROJECT_PATH")) + "/main.c" for key in mk_data: while makefile.find(key) != -1: @@ -206,8 +206,7 @@ def findModuleFiles(module, project_info): for filename, path in findDefinitions(module + ".c", project_info) + \ findDefinitions(module + "_" + project_info.info("CPU_INFOS")["TOOLCHAIN"] + ".c", project_info): path = path.replace(project_info.info("SOURCES_PATH") + os.sep, "") - if os.sep != "/": - path = replaceSeparators(path) + path = replaceSeparators(path) cfiles.append(path + "/" + filename) # .s files related to the module and the cpu architecture for filename, path in findDefinitions(module + ".s", project_info) + \ @@ -215,8 +214,7 @@ def findModuleFiles(module, project_info): findDefinitions(module + ".S", project_info) + \ findDefinitions(module + "_" + project_info.info("CPU_INFOS")["TOOLCHAIN"] + ".S", project_info): path = path.replace(project_info.info("SOURCES_PATH") + os.sep, "") - if os.sep != "/": - path = replaceSeparators(path) + path = replaceSeparators(path) sfiles.append(path + "/" + filename) # .c and .s files related to the module and the cpu tags for tag in project_info.info("CPU_INFOS")["CPU_TAGS"]: @@ -228,8 +226,7 @@ def findModuleFiles(module, project_info): for filename, path in findDefinitions(module + "_" + tag + ".s", project_info) + \ findDefinitions(module + "_" + tag + ".S", project_info): path = path.replace(project_info.info("SOURCES_PATH") + os.sep, "") - if os.sep != "/": - path = replaceSeparators(path) + path = replaceSeparators(path) sfiles.append(path + "/" + filename) return cfiles, sfiles @@ -237,8 +234,9 @@ def replaceSeparators(path): """ Replace the separators in the given path with unix standard separator. """ - while path.find(os.sep) != -1: - path = path.replace(os.sep, "/") + if os.sep != "/": + while path.find(os.sep) != -1: + path = path.replace(os.sep, "/") return path def getSystemPath():