parameters: (root, files, NAME, VERSION, SUMMARY, id_set)
docstring: This function creates the <features> tag based on the supplied xml tree.
  
      This is achieved by finding all <component>s and adding them to a default target.
  
      It should be called after the tree has been built completly.  We assume
      that a MY_DEFAULT_FOLDER Property is defined in the wxs file tree.
  
      Furthermore a top-level with the name and VERSION of the software will be created.
  
      An PACKAGING_X_MSI_FEATURE can either be a string, where the feature
      DESCRIPTION will be the same as its title or a Tuple, where the first
      part will be its title and the second its DESCRIPTION.
docstring_summary: This function creates the <features> tag based on the supplied xml tree.
docstring_tokens: This function creates the <features > tag based on the supplied xml tree .
function: def build_wxsfile_features_section(root, files, NAME, VERSION, SUMMARY, id_set):
      """ This function creates the <features> tag based on the supplied xml tree.
  
      This is achieved by finding all <component>s and adding them to a default target.
  
      It should be called after the tree has been built completly.  We assume
      that a MY_DEFAULT_FOLDER Property is defined in the wxs file tree.
  
      Furthermore a top-level with the name and VERSION of the software will be created.
  
      An PACKAGING_X_MSI_FEATURE can either be a string, where the feature
      DESCRIPTION will be the same as its title or a Tuple, where the first
      part will be its title and the second its DESCRIPTION.
      """
      factory = Document()
      Feature = factory.createElement('Feature')
      Feature.attributes['Id']                    = 'complete'
      Feature.attributes['ConfigurableDirectory'] = 'MY_DEFAULT_FOLDER'
      Feature.attributes['Level']                 = '1'
      Feature.attributes['Title']                 = escape( '%s %s' % (NAME, VERSION) )
      Feature.attributes['Description']           = escape( SUMMARY )
      Feature.attributes['Display']               = 'expand'
  
      for (feature, files) in create_feature_dict(files).items():
          SubFeature   = factory.createElement('Feature')
          SubFeature.attributes['Level'] = '1'
  
          if SCons.Util.is_Tuple(feature):
              SubFeature.attributes['Id']    = convert_to_id( feature[0], id_set )
              SubFeature.attributes['Title'] = escape(feature[0])
              SubFeature.attributes['Description'] = escape(feature[1])
          else:
              SubFeature.attributes['Id'] = convert_to_id( feature, id_set )
              if feature=='default':
                  SubFeature.attributes['Description'] = 'Main Part'
                  SubFeature.attributes['Title'] = 'Main Part'
              elif feature=='PACKAGING_DOC':
                  SubFeature.attributes['Description'] = 'Documentation'
                  SubFeature.attributes['Title'] = 'Documentation'
              else:
                  SubFeature.attributes['Description'] = escape(feature)
                  SubFeature.attributes['Title'] = escape(feature)
  
          # build the componentrefs. As one of the design decision is that every
          # file is also a component we walk the list of files and create a
          # reference.
          for f in files:
              ComponentRef = factory.createElement('ComponentRef')
              ComponentRef.attributes['Id'] = convert_to_id( os.path.basename(f.get_path()), id_set )
              SubFeature.childNodes.append(ComponentRef)
  
          Feature.childNodes.append(SubFeature)
  
      root.getElementsByTagName('Product')[0].childNodes.append(Feature)
function_tokens: def build_wxsfile_features_section ( root , files , NAME , VERSION , SUMMARY , id_set ) : factory = Document ( ) Feature = factory . createElement ( 'Feature' ) Feature . attributes [ 'Id' ] = 'complete' Feature . attributes [ 'ConfigurableDirectory' ] = 'MY_DEFAULT_FOLDER' Feature . attributes [ 'Level' ] = '1' Feature . attributes [ 'Title' ] = escape ( '%s %s' % ( NAME , VERSION ) ) Feature . attributes [ 'Description' ] = escape ( SUMMARY ) Feature . attributes [ 'Display' ] = 'expand' for ( feature , files ) in create_feature_dict ( files ) . items ( ) : SubFeature = factory . createElement ( 'Feature' ) SubFeature . attributes [ 'Level' ] = '1' if SCons . Util . is_Tuple ( feature ) : SubFeature . attributes [ 'Id' ] = convert_to_id ( feature [ 0 ] , id_set ) SubFeature . attributes [ 'Title' ] = escape ( feature [ 0 ] ) SubFeature . attributes [ 'Description' ] = escape ( feature [ 1 ] ) else : SubFeature . attributes [ 'Id' ] = convert_to_id ( feature , id_set ) if feature == 'default' : SubFeature . attributes [ 'Description' ] = 'Main Part' SubFeature . attributes [ 'Title' ] = 'Main Part' elif feature == 'PACKAGING_DOC' : SubFeature . attributes [ 'Description' ] = 'Documentation' SubFeature . attributes [ 'Title' ] = 'Documentation' else : SubFeature . attributes [ 'Description' ] = escape ( feature ) SubFeature . attributes [ 'Title' ] = escape ( feature ) # build the componentrefs. As one of the design decision is that every # file is also a component we walk the list of files and create a # reference. for f in files : ComponentRef = factory . createElement ( 'ComponentRef' ) ComponentRef . attributes [ 'Id' ] = convert_to_id ( os . path . basename ( f . get_path ( ) ) , id_set ) SubFeature . childNodes . append ( ComponentRef ) Feature . childNodes . append ( SubFeature ) root . getElementsByTagName ( 'Product' ) [ 0 ] . childNodes . append ( Feature )