| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2014 The Chromium Authors. All rights reserved. | 3 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """Renders one or more template files using the Jinja template engine.""" | 7 """Renders one or more template files using the Jinja template engine.""" |
| 8 | 8 |
| 9 import codecs | 9 import codecs |
| 10 import argparse | 10 import argparse |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 variables = _ParseVariables(options.variables, parser.error) | 121 variables = _ParseVariables(options.variables, parser.error) |
| 122 processor = JinjaProcessor(options.loader_base_dir, variables=variables) | 122 processor = JinjaProcessor(options.loader_base_dir, variables=variables) |
| 123 | 123 |
| 124 if options.output: | 124 if options.output: |
| 125 _ProcessFile(processor, inputs[0], options.output) | 125 _ProcessFile(processor, inputs[0], options.output) |
| 126 else: | 126 else: |
| 127 _ProcessFiles(processor, inputs, options.inputs_base_dir, | 127 _ProcessFiles(processor, inputs, options.inputs_base_dir, |
| 128 options.outputs_zip) | 128 options.outputs_zip) |
| 129 | 129 |
| 130 if options.depfile: | 130 if options.depfile: |
| 131 deps = processor.GetLoadedTemplates() + build_utils.GetPythonDependencies() | 131 output = options.output or options.outputs_zip |
| 132 build_utils.WriteDepfile(options.depfile, deps) | 132 deps = processor.GetLoadedTemplates() |
| 133 build_utils.WriteDepfile(options.depfile, output, deps) |
| 133 | 134 |
| 134 | 135 |
| 135 if __name__ == '__main__': | 136 if __name__ == '__main__': |
| 136 main() | 137 main() |
| OLD | NEW |