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

Side by Side Diff: remoting/tools/verify_resources.py

Issue 882463003: Basic webapp UI for host-offline-reason. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Verifies that GRD resource files define all the strings used by a given 6 """Verifies that GRD resource files define all the strings used by a given
7 set of source files. For file formats where it is not possible to infer which 7 set of source files. For file formats where it is not possible to infer which
8 strings represent message identifiers, localized strings should be explicitly 8 strings represent message identifiers, localized strings should be explicitly
9 annotated with the string "i18n-content", for example: 9 annotated with the string "i18n-content", for example:
10 10
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 for f in args: 151 for f in args:
152 if not VerifyFile(f, all_resources, used_tags): 152 if not VerifyFile(f, all_resources, used_tags):
153 exit_code = 1 153 exit_code = 1
154 154
155 if options.strict: 155 if options.strict:
156 warnings = False 156 warnings = False
157 # Determining if a resource is being used in the Android app is tricky 157 # Determining if a resource is being used in the Android app is tricky
158 # because it requires annotating and parsing Android XML layout files. 158 # because it requires annotating and parsing Android XML layout files.
159 # For now, exclude Android strings from this check. 159 # For now, exclude Android strings from this check.
160 for tag in non_android_resources: 160 for tag in non_android_resources:
161 if tag.endswith("_GENERATED_AT_RUNTIME"):
162 continue
161 if tag not in used_tags: 163 if tag not in used_tags:
162 print ('%s/%s:0: warning: %s is defined but not used') % \ 164 print ('%s/%s:0: warning: %s is defined but not used') % \
163 (os.getcwd(), sys.argv[2], tag) 165 (os.getcwd(), sys.argv[2], tag)
164 warnings = True 166 warnings = True
165 if warnings: 167 if warnings:
166 print WARNING_MESSAGE 168 print WARNING_MESSAGE
167 169
168 if exit_code == 0: 170 if exit_code == 0:
169 f = open(options.touch, 'a') 171 f = open(options.touch, 'a')
170 f.close() 172 f.close()
171 os.utime(options.touch, None) 173 os.utime(options.touch, None)
172 174
173 return exit_code 175 return exit_code
174 176
175 177
176 if __name__ == '__main__': 178 if __name__ == '__main__':
177 sys.exit(main()) 179 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698