parameters: (root, breadcrumb, level, exclude=[])
docstring: list all files and directory recursively
  	create the file_ids dictionary to be used in ComponentGroup references
docstring_summary: list all files and directory recursively
  	create the file_ids dictionary to be used in ComponentGroup references
docstring_tokens: list all files and directory recursively create the file_ids dictionary to be used in ComponentGroup references
function: def directory(root, breadcrumb, level, exclude=[]):
  	"""
  	list all files and directory recursively
  	create the file_ids dictionary to be used in ComponentGroup references
  	"""
  	global file_ids
  	global directory_ids
  	# first list files within directory
  	files = [ f for f in os.listdir(root) if os.path.isfile(os.path.join(root,f)) and f not in exclude]
  	for file in files:
  		file_key = os.path.join(root, file)
  		file_key = file_key.replace('/', '\\')  # for usage from MSYS2 shell
  		_id = '_%06d' % (len(file_ids.keys()) + 1)
  		file_ids[file_key] = 'component' + _id
  		wxs.write(indent(level)+ "<Component Id='component" + _id + "' Guid='" + str(uuid.uuid4()) + "' DiskId='1' Win64='$(var.Win64)'>\n")
  		if file == 'inkscape.exe':
  			# we reference 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")
  		wxs.write(indent(level)+ "</Component>\n")
  
  	# then all directories
  	dirs = [ f for f in os.listdir(root) if os.path.isdir(os.path.join(root,f)) ]
  	for dir in dirs:
  		directory_key = breadcrumb + '__' + dir
  		if not directory_key in directory_ids.keys():
  			directory_ids[directory_key] = 'dir_%06d' % (len(directory_ids.keys()) + 1)
  		wxs.write(indent(level) + "<Directory Id='" + directory_ids[directory_key] + "' Name='" + dir + "'>\n")
  		directory(os.path.join(root, dir), directory_key, level + 1)
  		wxs.write(indent(level) + "</Directory>\n")
function_tokens: def directory ( root , breadcrumb , level , exclude = [ ] ) : global file_ids global directory_ids # first list files within directory files = [ f for f in os . listdir ( root ) if os . path . isfile ( os . path . join ( root , f ) ) and f not in exclude ] for file in files : file_key = os . path . join ( root , file ) file_key = file_key . replace ( '/' , '\\' ) # for usage from MSYS2 shell _id = '_%06d' % ( len ( file_ids . keys ( ) ) + 1 ) file_ids [ file_key ] = 'component' + _id wxs . write ( indent ( level ) + "<Component Id='component" + _id + "' Guid='" + str ( uuid . uuid4 ( ) ) + "' DiskId='1' Win64='$(var.Win64)'>\n" ) if file == 'inkscape.exe' : # we reference 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" ) wxs . write ( indent ( level ) + "</Component>\n" ) # then all directories dirs = [ f for f in os . listdir ( root ) if os . path . isdir ( os . path . join ( root , f ) ) ] for dir in dirs : directory_key = breadcrumb + '__' + dir if not directory_key in directory_ids . keys ( ) : directory_ids [ directory_key ] = 'dir_%06d' % ( len ( directory_ids . keys ( ) ) + 1 ) wxs . write ( indent ( level ) + "<Directory Id='" + directory_ids [ directory_key ] + "' Name='" + dir + "'>\n" ) directory ( os . path . join ( root , dir ) , directory_key , level + 1 ) wxs . write ( indent ( level ) + "</Directory>\n" )