| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 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 import argparse | 6 import argparse |
| 7 import itertools | 7 import itertools |
| 8 import os | 8 import os |
| 9 import platform | 9 import platform |
| 10 import re | 10 import re |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 html_out_file, js_out_file): | 137 html_out_file, js_out_file): |
| 138 in_path = os.path.normpath(os.path.join(_CWD, in_folder)) | 138 in_path = os.path.normpath(os.path.join(_CWD, in_folder)) |
| 139 out_path = os.path.join(_CWD, out_folder) | 139 out_path = os.path.join(_CWD, out_folder) |
| 140 | 140 |
| 141 html_out_path = os.path.join(out_path, html_out_file) | 141 html_out_path = os.path.join(out_path, html_out_file) |
| 142 js_out_path = os.path.join(out_path, js_out_file) | 142 js_out_path = os.path.join(out_path, js_out_file) |
| 143 | 143 |
| 144 output = _run_node( | 144 output = _run_node( |
| 145 [node_modules.PathToVulcanize()] + | 145 [node_modules.PathToVulcanize()] + |
| 146 _VULCANIZE_BASE_ARGS + _VULCANIZE_REDIRECT_ARGS + | 146 _VULCANIZE_BASE_ARGS + _VULCANIZE_REDIRECT_ARGS + |
| 147 ['--out-request-list', os.path.join(out_path, _REQUEST_LIST_FILE), | 147 ['--out-request-list', os.path.normpath( |
| 148 os.path.join(out_path, _REQUEST_LIST_FILE)), |
| 148 '--redirect', '"/|%s"' % in_path, | 149 '--redirect', '"/|%s"' % in_path, |
| 149 '--redirect', '"chrome://%s/|%s"' % (host, in_path), | 150 '--redirect', '"chrome://%s/|%s"' % (host, in_path), |
| 150 # TODO(dpapad): Figure out why vulcanize treats the input path | 151 # TODO(dpapad): Figure out why vulcanize treats the input path |
| 151 # differently on Windows VS Linux/Mac. | 152 # differently on Windows VS Linux/Mac. |
| 152 os.path.join( | 153 os.path.join( |
| 153 in_path if platform.system() == 'Windows' else os.sep, | 154 in_path if platform.system() == 'Windows' else os.sep, |
| 154 html_in_file)]) | 155 html_in_file)]) |
| 155 | 156 |
| 156 with tempfile.NamedTemporaryFile(mode='wt+', delete=False) as tmp: | 157 with tempfile.NamedTemporaryFile(mode='wt+', delete=False) as tmp: |
| 157 # Grit includes are not supported, use HTML imports instead. | 158 # Grit includes are not supported, use HTML imports instead. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 | 208 |
| 208 _vulcanize(vulcanize_input_folder, args.out_folder, args.host, | 209 _vulcanize(vulcanize_input_folder, args.out_folder, args.host, |
| 209 args.html_in_file, args.html_out_file, args.js_out_file) | 210 args.html_in_file, args.html_out_file, args.js_out_file) |
| 210 _css_build(args.out_folder, files=[args.html_out_file]) | 211 _css_build(args.out_folder, files=[args.html_out_file]) |
| 211 | 212 |
| 212 _update_dep_file(vulcanize_input_folder, args) | 213 _update_dep_file(vulcanize_input_folder, args) |
| 213 | 214 |
| 214 | 215 |
| 215 if __name__ == '__main__': | 216 if __name__ == '__main__': |
| 216 main() | 217 main() |
| OLD | NEW |