parameters: (item, lang, output_dir, type=None, process_html=False)
return_statement: return '// ID: %d\n%-18s %-18s "%s"\n' % (item_id, name, type, filename)
docstring: Formats an item that is included in an .rc file (e.g. an ICON).
  
    Args:
      item: an IncludeNode or StructureNode
      lang, output_dir: standard formatter parameters
      type: .rc file resource type, e.g. 'ICON' (ignored unless item is a
            StructureNode)
      process_html: False/True (ignored unless item is a StructureNode)
docstring_summary: Formats an item that is included in an .rc file (e.g. an ICON).
docstring_tokens: Formats an item that is included in an . rc file ( e . g . an ICON ) .
function: def FormatInclude(item, lang, output_dir, type=None, process_html=False):
    '''Formats an item that is included in an .rc file (e.g. an ICON).
  
    Args:
      item: an IncludeNode or StructureNode
      lang, output_dir: standard formatter parameters
      type: .rc file resource type, e.g. 'ICON' (ignored unless item is a
            StructureNode)
      process_html: False/True (ignored unless item is a StructureNode)
    '''
    assert isinstance(lang, six.string_types)
    from grit.node import structure
    from grit.node import include
    assert isinstance(item, (structure.StructureNode, include.IncludeNode))
  
    if isinstance(item, include.IncludeNode):
      type = item.attrs['type'].upper()
      process_html = item.attrs['flattenhtml'] == 'true'
      filename_only = item.attrs['filenameonly'] == 'true'
      relative_path = item.attrs['relativepath'] == 'true'
    else:
      assert (isinstance(item, structure.StructureNode) and item.attrs['type'] in
          ['admin_template', 'chrome_html', 'chrome_scaled_image',
           'tr_html', 'txt'])
      filename_only = False
      relative_path = False
  
    # By default, we use relative pathnames to included resources so that
    # sharing the resulting .rc files is possible.
    #
    # The FileForLanguage() Function has the side effect of generating the file
    # if needed (e.g. if it is an HTML file include).
    file_for_lang = item.FileForLanguage(lang, output_dir)
    if file_for_lang is None:
      return ''
  
    filename = os.path.abspath(file_for_lang)
    if process_html:
      filename = item.Process(output_dir)
    elif filename_only:
      filename = os.path.basename(filename)
    elif relative_path:
      filename = util.MakeRelativePath(output_dir, filename)
  
    filename = filename.replace('\\', '\\\\')  # escape for the RC format
  
    if isinstance(item, structure.StructureNode) and item.IsExcludedFromRc():
      return ''
  
    name = item.attrs['name']
    item_id = item.GetRoot().GetIdMap()[name]
    return '// ID: %d\n%-18s %-18s "%s"\n' % (item_id, name, type, filename)
function_tokens: def FormatInclude ( item , lang , output_dir , type = None , process_html = False ) : assert isinstance ( lang , six . string_types ) from grit . node import structure from grit . node import include assert isinstance ( item , ( structure . StructureNode , include . IncludeNode ) ) if isinstance ( item , include . IncludeNode ) : type = item . attrs [ 'type' ] . upper ( ) process_html = item . attrs [ 'flattenhtml' ] == 'true' filename_only = item . attrs [ 'filenameonly' ] == 'true' relative_path = item . attrs [ 'relativepath' ] == 'true' else : assert ( isinstance ( item , structure . StructureNode ) and item . attrs [ 'type' ] in [ 'admin_template' , 'chrome_html' , 'chrome_scaled_image' , 'tr_html' , 'txt' ] ) filename_only = False relative_path = False # By default, we use relative pathnames to included resources so that # sharing the resulting .rc files is possible. # # The FileForLanguage() Function has the side effect of generating the file # if needed (e.g. if it is an HTML file include). file_for_lang = item . FileForLanguage ( lang , output_dir ) if file_for_lang is None : return '' filename = os . path . abspath ( file_for_lang ) if process_html : filename = item . Process ( output_dir ) elif filename_only : filename = os . path . basename ( filename ) elif relative_path : filename = util . MakeRelativePath ( output_dir , filename ) filename = filename . replace ( '\\' , '\\\\' ) # escape for the RC format if isinstance ( item , structure . StructureNode ) and item . IsExcludedFromRc ( ) : return '' name = item . attrs [ 'name' ] item_id = item . GetRoot ( ) . GetIdMap ( ) [ name ] return '// ID: %d\n%-18s %-18s "%s"\n' % ( item_id , name , type , filename )