Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Unified Diff: tools/unused-grit-header.py

Issue 510623002: Fix a couple small problems with tools/unused-grit-header.py. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/unused-grit-header.py
diff --git a/tools/unused-grit-header.py b/tools/unused-grit-header.py
index 37c734e84bbed63dce09068f29a9115b04e28bb0..da85b55f3809cd2be49e457e316f766289942d9a 100755
--- a/tools/unused-grit-header.py
+++ b/tools/unused-grit-header.py
@@ -78,12 +78,12 @@ def GetResourcesForGrdFile(tree, grd_file):
release_node = FindNodeWithTag(root, 'release')
assert release_node != None
- messages_node = FindNodeWithTag(root, 'messages')
+ messages_node = FindNodeWithTag(release_node, 'messages')
messages = set()
if messages_node != None:
messages = set(GetResourcesForNode(messages_node, grd_file, 'message'))
- includes_node = FindNodeWithTag(root, 'includes')
+ includes_node = FindNodeWithTag(release_node, 'includes')
includes = set()
if includes_node != None:
includes = set(GetResourcesForNode(includes_node, grd_file, 'include'))
@@ -180,6 +180,9 @@ def main(argv):
tree = xml.etree.ElementTree.parse(grd_file)
grit_header = GetOutputHeaderFile(tree)
+ if not grit_header:
+ print 'Error: %s does not generate any output headers.' % grit_header
+ return 1
resources = GetResourcesForGrdFile(tree, grd_file)
files_with_unneeded_grit_includes = []
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698