X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=wizard%2Fcompatibility.py;h=24a0805545f4c0fc13f68739461726fd058e71aa;hb=3d3ba83839f2a8faed6c373e5153d61672ce7fb6;hp=4d873f64b6969031e53662e574c1b4de42e7d48c;hpb=f89fe8efdb8b81d7d1f29e241df3b40042c42712;p=bertos.git diff --git a/wizard/compatibility.py b/wizard/compatibility.py index 4d873f64..24a08055 100644 --- a/wizard/compatibility.py +++ b/wizard/compatibility.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # encoding: utf-8 # -# This file is part of slimqc. +# This file is part of BeRTOS. # # Bertos is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,7 +28,6 @@ # # Copyright 2010 Develer S.r.l. (http://www.develer.com/) # -# $Id$ # # Author: Lorenzo Berni # @@ -45,8 +44,7 @@ def _userMkGenerator(project_info): mk_data["$pname"] = os.path.basename(project_info.info("PROJECT_PATH")) mk_data["$main"] = os.path.basename(project_info.info("PROJECT_PATH")) + "/main.c" for key in mk_data: - while makefile.find(key) != -1: - makefile = makefile.replace(key, mk_data[key]) + makefile = makefile.replace(key, mk_data[key]) open(destination, "w").write(makefile) def _mkGenerator(project_info): @@ -68,8 +66,7 @@ def _mkGenerator(project_info): 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: - makefile = makefile.replace(key, mk_data[key]) + makefile = makefile.replace(key, mk_data[key]) open(destination, "w").write(makefile) def _makefileGenerator(project_info): @@ -79,8 +76,7 @@ def _makefileGenerator(project_info): makefile = open(os.path.join(const.DATA_DIR, "mktemplates/old/Makefile"), "r").read() destination = os.path.join(project_info.maindir, "Makefile") # TODO write a general function that works for both the mk file and the Makefile - while makefile.find("$pname") != -1: - makefile = makefile.replace("$pname", project_info.info("PROJECT_NAME")) + makefile = makefile.replace("$pname", project_info.info("PROJECT_NAME")) open(destination, "w").write(makefile) def updateProject(project_data):