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

Unified Diff: tools/resources/find_used_resources.py

Issue 246533003: Make find_used_resources.py output resource ids in numerical order. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: add deps file Created 6 years, 8 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
« DEPS ('K') | « DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/resources/find_used_resources.py
===================================================================
--- tools/resources/find_used_resources.py (revision 265149)
+++ tools/resources/find_used_resources.py (working copy)
@@ -9,7 +9,7 @@
usage = """find_used_resources.py
-Prints out (to sdout) the sorted list of resource ids that are part of unknown
+Prints out (to stdout) the sorted list of resource ids that are part of unknown
pragma warning in the given build log (via stdin).
This script is used to find the resources that are actually compiled in Chrome
@@ -32,11 +32,11 @@
"""
used_resources = set()
unknown_pragma_warning_pattern = re.compile(
- 'whitelisted_resource_(?P<resource_id>[0-9]*)')
+ 'whitelisted_resource_(?P<resource_id>[0-9]+)')
for ln in input:
match = unknown_pragma_warning_pattern.search(ln)
if match:
- resource_id = match.group('resource_id')
+ resource_id = int(match.group('resource_id'))
used_resources.add(resource_id)
return sorted(used_resources)
@@ -46,8 +46,8 @@
sys.exit(1)
else:
used_resources = GetResourceIdsInPragmaWarnings(sys.stdin)
- for rid in used_resources:
- sys.stdout.write(rid + '\n')
+ for resource_id in used_resources:
+ sys.stdout.write('%d\n' % resource_id)
if __name__ == '__main__':
Main()
« DEPS ('K') | « DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698