# list files in directory
import os
import uuid
directory_ids = {}
file_ids = {}
indentstring = ''
indentstring += ' '
return indentstring
"""
list all files and directory recursivly
create the file_ids dictionary to be used in ComponentGroup references
"""
global file_ids
global directory_ids
# first list files within directory
wxs.write(indent(level)+ "<Component Id='component" + _id + "' Guid='" + str(uuid.uuid4()) + "' DiskId='1' Win64='$(var.Win64)'>\n")
if file == 'inkscape.exe':
# we refenrence inkscape.exe in inkscape.wxs
_id = '_inkscape_exe'
wxs.write(indent(level + 1)+ "<File Id='file" + _id + "' Name='" + file + "' DiskId='1' Source='" + file_key + "' KeyPath='yes' />\n")
# then all directories
wxs.write(indent(level) + "<Directory Id='" + directory_ids[directory_key] + "' Name='" + dir + "'>\n")
"""
add componentgroup that contain all items from file_ids that match condition
remove the matched elements from file_ids
"""
global file_ids
print "start parsing ..\..\inkscape"
# link to ProgrmMenu
wxs.write(indent(4) + "<Directory Id='ApplicationProgramsFolder' Name='$(var.FullProductName)'/>\n")