import shutil
import const
+import codelite_project
import DefineException
def isBertosDir(directory):
csrc = " \\\n\t".join(files) + " \\"
return csrc
-def clFiles(fileDict, directory):
- filelist = []
- filelist.append("<VirtualDirectory Name=\"%s\">" %os.path.basename(directory))
- for f in fileDict[directory]["files"]:
- filelist.append("<File Name=\"%s\"/>" %os.path.join(directory, f))
- for d in fileDict[directory]["dirs"]:
- filelist += clFiles(fileDict, os.path.join(directory, d))
- filelist.append("</VirtualDirectory>")
- return filelist
-
-def findSources(path):
- fileDict = {}
- for root, dirs, files in os.walk(path):
- if root.find("svn") == -1:
- fileDict[root] = {"dirs": [], "files": []}
- for dir in dirs:
- if dir.find("svn") == -1:
- fileDict[root]["dirs"].append(dir)
- for file in files:
- if file.endswith(const.EXTENSION_FILTER):
- fileDict[root]["files"].append(file)
- return fileDict
-
def codeliteProjectGenerator(projectInfo):
template = open("cltemplates/bertos.project").read()
- filelist = "\n".join(clFiles(findSources(projectInfo.info("PROJECT_PATH")), projectInfo.info("PROJECT_PATH")))
+ filelist = "\n".join(codelite_project.clFiles(codelite_project.findSources(projectInfo.info("PROJECT_PATH")), projectInfo.info("PROJECT_PATH")))
while template.find("$filelist") != -1:
template = template.replace("$filelist", filelist)
return template
--- /dev/null
+#!/usr/bin/env python
+# encoding: utf-8
+#
+# Copyright 2009 Develer S.r.l. (http://www.develer.com/)
+# All rights reserved.
+#
+# $Id:$
+#
+# Author: Lorenzo Berni <duplo@develer.com>
+#
+
+import os
+
+import const
+
+def clFiles(fileDict, directory):
+ filelist = []
+ filelist.append("<VirtualDirectory Name=\"%s\">" %os.path.basename(directory))
+ for f in fileDict[directory]["files"]:
+ filelist.append("<File Name=\"%s\"/>" %os.path.join(directory, f))
+ for d in fileDict[directory]["dirs"]:
+ filelist += clFiles(fileDict, os.path.join(directory, d))
+ filelist.append("</VirtualDirectory>")
+ return filelist
+
+def findSources(path):
+ fileDict = {}
+ for root, dirs, files in os.walk(path):
+ if root.find("svn") == -1:
+ fileDict[root] = {"dirs": [], "files": []}
+ for dir in dirs:
+ if dir.find("svn") == -1:
+ fileDict[root]["dirs"].append(dir)
+ for file in files:
+ if file.endswith(const.EXTENSION_FILTER):
+ fileDict[root]["files"].append(file)
+ return fileDict