def _AppendFiltersForMSBuild(parent_filter_name, sources, rule_dependencies, extension_to_rule_name, filter_group, source_group):
 for source in sources:
  if isinstance(source, MSVSProject.Filter):
   if (not parent_filter_name):
    filter_name = source.name
   else:
    filter_name = ('%s\\%s' % (parent_filter_name, source.name))
   filter_group.append(['Filter', {'Include': filter_name}, ['UniqueIdentifier', MSVSNew.MakeGuid(source.name)]])
   _AppendFiltersForMSBuild(filter_name, source.contents, rule_dependencies, extension_to_rule_name, filter_group, source_group)
  else:
   (_, element) = _MapFileToMsBuildSourceType(source, rule_dependencies, extension_to_rule_name)
   source_entry = [element, {'Include': source}]
   if parent_filter_name:
    source_entry.append(['Filter', parent_filter_name])
   source_group.append(source_entry)

def _AppendFiltersForMSBuild ( parent_filter_name , sources , rule_dependencies , extension_to_rule_name , filter_group , source_group ) : for source in sources : if isinstance ( source , MSVSProject . Filter ) : if ( not parent_filter_name ) : filter_name = source . name else : filter_name = ( '%s\\%s' % ( parent_filter_name , source . name ) ) filter_group . append ( [ 'Filter' , { 'Include' : filter_name } , [ 'UniqueIdentifier' , MSVSNew . MakeGuid ( source . name ) ] ] ) _AppendFiltersForMSBuild ( filter_name , source . contents , rule_dependencies , extension_to_rule_name , filter_group , source_group ) else : ( _ , element ) = _MapFileToMsBuildSourceType ( source , rule_dependencies , extension_to_rule_name ) source_entry = [ element , { 'Include' : source } ] if parent_filter_name : source_entry . append ( [ 'Filter' , parent_filter_name ] ) source_group . append ( source_entry )
creates the list of filters and sources to be added in the filter file .