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..b236f0c960770ae3e047451d0d572f3be9a9090d 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.print_to_filelist: |
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.print_to_filelist: |
+ # Strip off the quotes from each filename when writing into a listfile. |
+ content = u'\n'.join([x.strip('"') for x in outputs]) |
+ WriteIfChanged(options.print_to_filelist, 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( |
+ '--print_to_filelist', dest='print_to_filelist', type='string', |
Jamie
2015/02/05 19:26:20
print_to_filelist sounds like it should be a boole
garykac
2015/02/06 02:13:35
Done.
|
+ help='print the output file names into a 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.print_to_filelist): |
+ parser.error('The template name is required unless either --print_only ' |
+ 'or --print_to_filelist is used') |
return Localize(options.template, locales, options) |
if __name__ == '__main__': |
sys.exit(DoMain(sys.argv[1:])) |
- |