files.py revision 3ccb10e19925ccac46a3d8b7e08dad171f925bd9
# 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'>\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