Change variable name to follow the develer python coding standard
[bertos.git] / wizard / codelite_project.py
1 #!/usr/bin/env python
2 # encoding: utf-8
3 #
4 # Copyright 2009 Develer S.r.l. (http://www.develer.com/)
5 # All rights reserved.
6 #
7 # $Id:$
8 #
9 # Author: Lorenzo Berni <duplo@develer.com>
10 #
11
12 import os
13
14 import const
15
16 def clFiles(file_dict, directory):
17     filelist = []
18     filelist.append("<VirtualDirectory Name=\"%s\">" %os.path.basename(directory))
19     for f in file_dict[directory]["files"]:
20         filelist.append("<File Name=\"%s\"/>" %os.path.join(directory, f))
21     for d in file_dict[directory]["dirs"]:
22         filelist += clFiles(file_dict, os.path.join(directory, d))
23     filelist.append("</VirtualDirectory>")
24     return filelist
25
26 def findSources(path):
27     file_dict = {}
28     for root, dirs, files in os.walk(path):
29         if root.find("svn") == -1:
30             file_dict[root] = {"dirs": [], "files": []}
31             for dir in dirs:
32                 if dir.find("svn") == -1:
33                     file_dict[root]["dirs"].append(dir)
34             for file in files:
35                 if file.endswith(const.EXTENSION_FILTER):
36                     file_dict[root]["files"].append(file)
37     return file_dict