tools/resources/list_unused_grit_header.py
def GetOutputFileForNode(node):
  """Find the output file starting from a given node.

  Args:
    node: The root node to scan from.

  Returns:
    A grit header file name.
  """
  output_file = None
  for child in node.getchildren():
    if child.tag == 'output':
      if child.attrib['type'] == 'rc_header':
        assert output_file is None
        output_file = child.attrib['filename']
    elif child.tag in IF_ELSE_THEN_TAGS:
      child_output_file = GetOutputFileForNode(child)
      if not child_output_file:
        continue
      assert output_file is None
      output_file = child_output_file
    else:
      raise Exception('unknown tag:', child.tag)
  return output_file
Find the output file starting from a given node.

  Args:
    node: The root node to scan from.

  Returns:
    A grit header file name.
  
Find the output file starting from a given node.
Find the output file starting from a given node .
def GetOutputFileForNode(node):
  output_file = None
  for child in node.getchildren():
    if child.tag == 'output':
      if child.attrib['type'] == 'rc_header':
        assert output_file is None
        output_file = child.attrib['filename']
    elif child.tag in IF_ELSE_THEN_TAGS:
      child_output_file = GetOutputFileForNode(child)
      if not child_output_file:
        continue
      assert output_file is None
      output_file = child_output_file
    else:
      raise Exception('unknown tag:', child.tag)
  return output_file
def GetOutputFileForNode ( node ) : output_file = None for child in node . getchildren ( ) : if child . tag == 'output' : if child . attrib [ 'type' ] == 'rc_header' : assert output_file is None output_file = child . attrib [ 'filename' ] elif child . tag in IF_ELSE_THEN_TAGS : child_output_file = GetOutputFileForNode ( child ) if not child_output_file : continue assert output_file is None output_file = child_output_file else : raise Exception ( 'unknown tag:' , child . tag ) return output_file
Find the output file starting from a given node.
Find the output file starting from a given node .
"""Find the output file starting from a given node.

  Args:
    node: The root node to scan from.

  Returns:
    A grit header file name.
  """
A grit header file name.
A grit header file name .
node
The root node to scan from.
The root node to scan from .