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

Unified Diff: grit/tool/build.py

Issue 9802029: Make first_ids_file an optional attribute of the .grd file. (Closed) Base URL: http://grit-i18n.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 9 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
« grit/node/misc.py ('K') | « grit/node/misc.py ('k') | grit_info.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grit/tool/build.py
===================================================================
--- grit/tool/build.py (revision 18)
+++ grit/tool/build.py (working copy)
@@ -56,10 +56,10 @@
-E NAME=VALUE Set environment variable NAME to VALUE (within grit).
- -f FIRSTIDFILE Path to a python file that specifies the first id of
- value to use for resources. Defaults to the file
- resources_ids next to grit.py. Set to an empty string
- if you don't want to use a first id file.
+ -f FIRSTIDSFILE Path to a python file that specifies the first id of
+ value to use for resources. A non-empty value here will
+ override the value specified in the <grit> node's
+ first_ids_file.
-w WHITELISTFILE Path to a file containing the string names of the
resources to include. Anything not listed is dropped.
@@ -77,7 +77,7 @@
def Run(self, opts, args):
self.output_directory = '.'
- first_id_filename = None
+ first_ids_file = None
whitelist_filenames = []
(own_opts, args) = getopt.getopt(args, 'o:D:E:f:w:')
for (key, val) in own_opts:
@@ -90,7 +90,10 @@
(env_name, env_value) = val.split('=')
os.environ[env_name] = env_value
elif key == '-f':
- first_id_filename = val
+ # TODO(joi@chromium.org): Remove this override once change
+ # lands in WebKit.grd to specify the first_ids_file in the
+ # .grd itself.
tony 2012/03/28 17:31:56 I like the command line flag. In Chromium, if some
Jói 2012/03/29 11:36:15 I'd prefer to have just one way to do things, but
+ first_ids_file = val
elif key == '-w':
whitelist_filenames.append(val)
@@ -113,8 +116,10 @@
self.whitelist_names |= set(whitelist_file.read().strip().split('\n'))
whitelist_file.close()
- self.res = grd_reader.Parse(opts.input, first_id_filename=first_id_filename,
- debug=opts.extra_verbose, defines=self.defines)
+ self.res = grd_reader.Parse(opts.input,
+ debug=opts.extra_verbose,
+ first_ids_file=first_ids_file,
+ defines=self.defines)
self.res.RunGatherers(recursive = True)
self.Process()
return 0
« grit/node/misc.py ('K') | « grit/node/misc.py ('k') | grit_info.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698