From: duplo Date: Mon, 29 Mar 2010 14:06:41 +0000 (+0000) Subject: Avoid the double csrc list generation. X-Git-Tag: 2.5.0~608 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=f07612b84871885db65df773f0a6c0e8e98f0a59;p=bertos.git Avoid the double csrc list generation. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3298 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index 4be3d536..808485b0 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -236,7 +236,8 @@ def createBertosProject(project_info, edit=False): if not edit: # Destination user mk file (only on project creation) makefile = open(os.path.join(const.DATA_DIR, "mktemplates/template.mk"), "r").read() - makefile = mkGenerator(project_info, makefile) + # Deadly performances loss was here :( + makefile = userMkGenerator(project_info, makefile) open(prjdir + "/" + os.path.basename(prjdir) + ".mk", "w").write(makefile) # Destination wizard mk file makefile = open(os.path.join(const.DATA_DIR, "mktemplates/template_wiz.mk"), "r").read() @@ -263,6 +264,14 @@ def versionFileGenerator(project_info, version_file): version = bertosVersion(project_info.info("SOURCES_PATH")) return version_file.replace('$version', version) +def userMkGenerator(project_info, makefile): + mk_data = {} + mk_data["$pname"] = os.path.basename(project_info.info("PROJECT_PATH")) + for key in mk_data: + while makefile.find(key) != -1: + makefile = makefile.replace(key, mk_data[key]) + return makefile + def mkGenerator(project_info, makefile): """ Generates the mk file for the current project.