Move to codelite_project module the codelite specific project creation functions
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 9 Mar 2009 10:59:09 +0000 (10:59 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 9 Mar 2009 10:59:09 +0000 (10:59 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2388 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/bertos_utils.py
wizard/codelite_project.py [new file with mode: 0644]

index 3c7407bfbd846d2a7dc78ce4f3ed6d9030efe9e2..81ce7bbc9255ce2dad1a90a6e034ae666a5d7368 100644 (file)
@@ -16,6 +16,7 @@ import re
 import shutil
 
 import const
+import codelite_project
 import DefineException
 
 def isBertosDir(directory):
@@ -113,32 +114,9 @@ def csrcGenerator(projectInfo):
     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
diff --git a/wizard/codelite_project.py b/wizard/codelite_project.py
new file mode 100644 (file)
index 0000000..6b0974b
--- /dev/null
@@ -0,0 +1,37 @@
+#!/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