Remove empty VDir in codelite projects.
authorlottaviano <lottaviano@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 31 Aug 2009 15:03:26 +0000 (15:03 +0000)
committerlottaviano <lottaviano@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 31 Aug 2009 15:03:26 +0000 (15:03 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2829 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/plugins/codelite.py

index 9f4b2540666b7d9c789decccfe2473b4d162196c..1789c52048eb5eccaaa04efa567dc1a2fcedf988 100644 (file)
@@ -63,12 +63,16 @@ def clFiles(file_dict, directory):
     directory as the base folder.
     """
     filelist = []
-    filelist.append("<VirtualDirectory Name=\"%s\">" %os.path.basename(directory))
+    # Do not create an empty VDir.
+    # TODO: this is *really* ugly, but an empty VDir is worse
+    if directory:
+        filelist.append("<VirtualDirectory Name=\"%s\">" %os.path.basename(directory))
     for f in file_dict[directory]["files"]:
         filelist.append("<File Name=\"%s\"/>" %os.path.join(directory, f))
     for d in file_dict[directory]["dirs"]:
         filelist += clFiles(file_dict, os.path.join(directory, d))
-    filelist.append("</VirtualDirectory>")
+    if directory:
+        filelist.append("</VirtualDirectory>")
     return filelist
 
 def findSources(path):