import const
def clFiles(file_dict, directory):
+ """
+ Creates the list of the lines for the files founded in file_dict, using
+ directory as the base folder.
+ """
filelist = []
filelist.append("<VirtualDirectory Name=\"%s\">" %os.path.basename(directory))
for f in file_dict[directory]["files"]:
return filelist
def findSources(path):
+ """
+ Analyzes the directory tree from path and return a dict with filename and
+ path.
+ """
file_dict = {}
for root, dirs, files in os.walk(path):
if root.find("svn") == -1:
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")))
while template.find("$filelist") != -1:
return template
def codeliteWorkspaceGenerator(project_info):
+ """
+ Returns the string rapresentig the codelite workspace.
+ """
template = open("cltemplates/bertos.workspace").read()
project_name = os.path.basename(project_info.info("PROJECT_PATH"))
while template.find("$project") != -1: