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

Unified Diff: remoting/tools/build/remoting_localize.py

Issue 905553002: [Chromoting] Pass list of locale files into build-webapp in a single file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove --locales option from build-webapp.py 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 side-by-side diff with in-line comments
Download patch
Index: remoting/tools/build/remoting_localize.py
diff --git a/remoting/tools/build/remoting_localize.py b/remoting/tools/build/remoting_localize.py
index 466a86efea317f7a3cc01f3598aee957e40fd4cd..4b6c90181143f04544e8d3124565e4a7ec205c04 100755
--- a/remoting/tools/build/remoting_localize.py
+++ b/remoting/tools/build/remoting_localize.py
@@ -720,7 +720,7 @@ def Localize(source, locales, options):
template_file_name = target.safe_substitute(context)
outputs.append(template_file_name)
- if not options.print_only:
+ if not options.print_only and not options.locales_listfile:
WriteIfChanged(template_file_name, template.render(context),
options.encoding)
else:
@@ -733,6 +733,11 @@ def Localize(source, locales, options):
# it into a list.
return " ".join(['"%s"' % x for x in outputs])
+ if options.locales_listfile:
+ # Strip off the quotes from each filename when writing into a listfile.
+ content = u'\n'.join([x.strip('"') for x in outputs])
+ WriteIfChanged(options.locales_listfile, content, options.encoding)
+
return
@@ -761,6 +766,9 @@ def DoMain(argv):
'--print_only', dest='print_only', action='store_true',
default=False, help='print the output file names only.')
parser.add_option(
+ '--locales_listfile', dest='locales_listfile', type='string',
+ help='print the output file names into the specified file.')
+ parser.add_option(
'-t', '--template', dest='template', type='string',
help="specify the template file name.")
parser.add_option(
@@ -773,11 +781,12 @@ def DoMain(argv):
if bool(options.output) == bool(options.locale_output):
parser.error(
'Either --output or --locale_output must be specified but not both')
- if not options.template and not options.print_only:
- parser.error('The template name is required unless --print_only is used')
+ if (not options.template and
+ not options.print_only and not options.locales_listfile):
+ parser.error('The template name is required unless either --print_only '
+ 'or --locales_listfile is used')
return Localize(options.template, locales, options)
if __name__ == '__main__':
sys.exit(DoMain(sys.argv[1:]))
-

Powered by Google App Engine
This is Rietveld 408576698