tools/resources/list_unused_grit_header.py
def GetResourcesForGrdFile(tree, grd_file):
  """Find all the message and include resources from a given grit file.

  Args:
    tree: The XML tree.
    grd_file: The file that contains the XML tree.

  Returns:
    A list of resource names.
  """
  root = tree.getroot()
  assert root.tag == 'grit'
  release_node = FindNodeWithTag(root, 'release')
  assert release_node != None

  resources = set()
  for node_type in ('message', 'include', 'structure'):
    resources_node = FindNodeWithTag(release_node, node_type + 's')
    if resources_node != None:
      resources = resources.union(
          set(GetResourcesForNode(resources_node, grd_file, node_type)))
  return resources
Find all the message and include resources from a given grit file.

  Args:
    tree: The XML tree.
    grd_file: The file that contains the XML tree.

  Returns:
    A list of resource names.
  
Find all the message and include resources from a given grit file.
Find all the message and include resources from a given grit file .
def GetResourcesForGrdFile(tree, grd_file):
  root = tree.getroot()
  assert root.tag == 'grit'
  release_node = FindNodeWithTag(root, 'release')
  assert release_node != None
  resources = set()
  for node_type in ('message', 'include', 'structure'):
    resources_node = FindNodeWithTag(release_node, node_type + 's')
    if resources_node != None:
      resources = resources.union(
          set(GetResourcesForNode(resources_node, grd_file, node_type)))
  return resources
def GetResourcesForGrdFile ( tree , grd_file ) : root = tree . getroot ( ) assert root . tag == 'grit' release_node = FindNodeWithTag ( root , 'release' ) assert release_node != None resources = set ( ) for node_type in ( 'message' , 'include' , 'structure' ) : resources_node = FindNodeWithTag ( release_node , node_type + 's' ) if resources_node != None : resources = resources . union ( set ( GetResourcesForNode ( resources_node , grd_file , node_type ) ) ) return resources
Find all the message and include resources from a given grit file.
Find all the message and include resources from a given grit file .
"""Find all the message and include resources from a given grit file.

  Args:
    tree: The XML tree.
    grd_file: The file that contains the XML tree.

  Returns:
    A list of resource names.
  """
A list of resource names.
A list of resource names .
tree
The XML tree.
The XML tree .
grd_file
The file that contains the XML tree.
The file that contains the XML tree .