X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2Fplugins%2Fcodelite_project.py;h=ba03b2a5aa64e2125c09f9a7c767dd29070bb12d;hb=81123d01fd691c067b145f4bdc04c6b238634246;hp=c55c7dc4dcbee9f45ac41f8f9226b157eb377259;hpb=17c1195c6f3579b1f6600c9a9735c7729ae27ecc;p=bertos.git diff --git a/wizard/plugins/codelite_project.py b/wizard/plugins/codelite_project.py index c55c7dc4..ba03b2a5 100644 --- a/wizard/plugins/codelite_project.py +++ b/wizard/plugins/codelite_project.py @@ -32,24 +32,26 @@ def findSources(path): Analyzes the directory tree from path and return a dict with filename and path. """ + if not path.endswith(os.sep): + path += os.sep file_dict = {} for root, dirs, files in os.walk(path): if root.find("svn") == -1: - file_dict[root] = {"dirs": [], "files": []} + file_dict[root.replace(path, "")] = {"dirs": [], "files": []} for dir in dirs: if dir.find("svn") == -1: - file_dict[root]["dirs"].append(dir) + file_dict[root.replace(path, "")]["dirs"].append(dir) for file in files: if file.endswith(const.EXTENSION_FILTER): - file_dict[root]["files"].append(file) + file_dict[root.replace(path, "")]["files"].append(file) return file_dict def codeliteProjectGenerator(project_info): """ Returns the string rapresenting the codelite project. """ - template = open("cltemplates/bertos.project").read() - filelist = "\n".join(clFiles(findSources(project_info.info("PROJECT_PATH")), project_info.info("PROJECT_PATH"))) + template = open("cltemplates/bertos.project", "r").read() + filelist = "\n".join(clFiles(findSources(project_info.info("PROJECT_PATH")), "")) while template.find("$filelist") != -1: template = template.replace("$filelist", filelist) project_name = os.path.basename(project_info.info("PROJECT_PATH")) @@ -61,7 +63,7 @@ def codeliteWorkspaceGenerator(project_info): """ Returns the string rapresentig the codelite workspace. """ - template = open("cltemplates/bertos.workspace").read() + template = open("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)