| OLD | NEW |
| 1 #! /usr/bin/env python | 1 #! /usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2017 The Chromium Authors. All rights reserved. | 3 # Copyright 2017 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 import argparse | 7 import argparse |
| 8 import collections | 8 import collections |
| 9 import json | 9 import json |
| 10 import os | 10 import os |
| 11 import sys | 11 import sys |
| 12 | 12 |
| 13 CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) | 13 CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) |
| 14 BASE_DIR = os.path.abspath(os.path.join( | 14 BASE_DIR = os.path.abspath(os.path.join( |
| 15 CURRENT_DIR, '..', '..', '..', '..', '..')) | 15 CURRENT_DIR, '..', '..', '..', '..', '..')) |
| 16 sys.path.append(os.path.join(BASE_DIR, 'third_party', 'markupsafe')) | 16 sys.path.append(os.path.join(BASE_DIR, 'third_party', 'markupsafe')) |
| 17 sys.path.append(os.path.join(BASE_DIR, 'third_party', 'jinja2')) | 17 sys.path.append(os.path.join(BASE_DIR, 'third_party', 'jinja2')) |
| 18 import jinja2 | 18 import jinja2 # pylint: disable=import-error |
| 19 JINJA_ENVIRONMENT = jinja2.Environment( | 19 JINJA_ENVIRONMENT = jinja2.Environment( |
| 20 loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), | 20 loader=jinja2.FileSystemLoader(os.path.dirname(__file__)), |
| 21 autoescape=True) | 21 autoescape=True) |
| 22 | 22 |
| 23 | 23 |
| 24 def cell(data, html_class='center'): | 24 def cell(data, html_class='center'): |
| 25 """Formats table cell data for processing in jinja template.""" | 25 """Formats table cell data for processing in jinja template.""" |
| 26 return { | 26 return { |
| 27 'data': data, | 27 'data': data, |
| 28 'class': html_class, | 28 'class': html_class, |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 if os.path.exists(args.json_file): | 287 if os.path.exists(args.json_file): |
| 288 result_html_string = result_details(args.json_file, args.cs_base_url, | 288 result_html_string = result_details(args.json_file, args.cs_base_url, |
| 289 args.master_name) | 289 args.master_name) |
| 290 print result_html_string.encode('UTF-8') | 290 print result_html_string.encode('UTF-8') |
| 291 else: | 291 else: |
| 292 raise IOError('--json-file %s not found.' % args.json_file) | 292 raise IOError('--json-file %s not found.' % args.json_file) |
| 293 | 293 |
| 294 | 294 |
| 295 if __name__ == '__main__': | 295 if __name__ == '__main__': |
| 296 sys.exit(main()) | 296 sys.exit(main()) |
| OLD | NEW |