X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2Fplugins%2Fcodelite.py;h=1638823304d0ad243fc2c7127496c63f45795126;hb=e99643019383b3972645443bb03aaaec734f4589;hp=0797da98aecacf205e9f375a43888ee5b7168d5a;hpb=73f44b2bb0d5fe6d39ffc894bf13ff063b19237c;p=bertos.git diff --git a/wizard/plugins/codelite.py b/wizard/plugins/codelite.py index 0797da98..16388233 100644 --- a/wizard/plugins/codelite.py +++ b/wizard/plugins/codelite.py @@ -88,7 +88,7 @@ def findSources(path): file_dict[root.replace(path, "")] = {"dirs": [], "files": []} for dir in dirs: # TODO: place the directory name in a constant file. - if dir.find("svn") == -1 and dir != "images" and dir != "obj": + if dir.find("svn") == -1 and dir != "images" and dir != "obj" and dir != "doc": file_dict[root.replace(path, "")]["dirs"].append(dir) for file in files: if file.endswith(const.EXTENSION_FILTER) and file != "buildrev.h": @@ -99,27 +99,22 @@ def codeliteProjectGenerator(project_info): """ Returns the string rapresenting the codelite project. """ - template = open("cltemplates/bertos.project", "r").read() + template = open(os.path.join(const.DATA_DIR, "cltemplates/bertos.project"), "r").read() filelist = "\n".join(clFiles(findSources(project_info.info("PROJECT_PATH")), "")) debugger_path = project_info.info("TOOLCHAIN")["path"].replace("gcc", "gdb") init_script = project_info.info("CPU_INFOS")["GDB_INIT_SCRIPT"] - while template.find("$filelist") != -1: - template = template.replace("$filelist", filelist) + template = template.replace("$filelist", filelist) project_name = os.path.basename(project_info.info("PROJECT_PATH")) - while template.find("$project") != -1: - template = template.replace("$project", project_name) - while template.find("$debuggerpath") != -1: - template = template.replace("$debuggerpath", debugger_path) - while template.find("$initscript") != -1: - template = template.replace("$initscript", init_script) + template = template.replace("$project", project_name) + template = template.replace("$debuggerpath", debugger_path) + template = template.replace("$initscript", init_script) return template def codeliteWorkspaceGenerator(project_info): """ Returns the string rapresentig the codelite workspace. """ - template = open("cltemplates/bertos.workspace", "r").read() + template = open(os.path.join(const.DATA_DIR, "cltemplates/bertos.workspace"), "r").read() project_name = os.path.basename(project_info.info("PROJECT_PATH")) - while template.find("$project") != -1: - template = template.replace("$project", project_name) + template = template.replace("$project", project_name) return template