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

Unified Diff: tools/grit/grit/format/resource_map.py

Issue 2153763005: Modify grit unit tests to test for missing resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moar Created 4 years, 5 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 | tools/grit/grit/format/resource_map_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/grit/grit/format/resource_map.py
diff --git a/tools/grit/grit/format/resource_map.py b/tools/grit/grit/format/resource_map.py
index e48182cab1c2907731e51dbe25e410ec2c3a32c8..e5fdd16ef203764e912a454fccd48762ae4464ec 100755
--- a/tools/grit/grit/format/resource_map.py
+++ b/tools/grit/grit/format/resource_map.py
@@ -16,9 +16,9 @@ from grit import util
def GetFormatter(type):
if type == 'resource_map_header':
return _FormatHeader
- elif type == 'resource_map_source':
+ if type == 'resource_map_source':
return partial(_FormatSource, _GetItemName)
- elif type == 'resource_file_map_source':
+ if type == 'resource_file_map_source':
return partial(_FormatSource, _GetItemPath)
@@ -37,9 +37,9 @@ def GetMapName(root):
raise Exception('unable to find resource header filename')
filename = os.path.splitext(os.path.split(rc_header_file)[1])[0]
filename = filename[0].upper() + filename[1:]
- while filename.find('_') != -1:
+ while True:
pos = filename.find('_')
- if pos >= len(filename):
+ if pos == -1 or pos >= len(filename):
break
filename = filename[:pos] + filename[pos + 1].upper() + filename[pos + 2:]
return 'k' + filename
« no previous file with comments | « no previous file | tools/grit/grit/format/resource_map_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698