OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2012 The Chromium Authors. All rights reserved. | 2 # Copyright 2012 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 import os | 5 import os |
6 import sys | 6 import sys |
7 | 7 |
8 | 8 |
9 from chrome_telemetry_build import chromium_config | 9 from chrome_telemetry_build import chromium_config |
10 sys.path.append(chromium_config.GetTelemetryDir()) | 10 sys.path.append(chromium_config.GetTelemetryDir()) |
11 | 11 |
12 from telemetry import record_wpr | 12 from telemetry import record_wpr |
13 | 13 |
14 # This is required to resolve importing davclient in tools/perf/third_party/ | 14 # This is required to resolve importing davclient in tools/perf/third_party/ |
15 # when record_wpr try to dynamically discover benchmark classes. | 15 # when record_wpr try to dynamically discover benchmark classes. |
16 import third_party # pylint: disable=unused-import | 16 import third_party # pylint: disable=unused-import |
17 | 17 |
18 | 18 |
19 _WARNING_PATTERN = '\033[93m%s\033[0m' # Use yellow color for warning. | 19 _WARNING_PATTERN = '\033[93m%s\033[0m' # Use yellow color for warning. |
20 | 20 |
21 | 21 |
22 def _WarnPythonVersion(): | 22 def _WarnPythonVersion(): |
23 print (_WARNING_PATTERN % | 23 print (_WARNING_PATTERN % |
24 ("Your system python's version is less than 2.7.9. " | 24 ("Your system python's version is less than 2.7.9. " |
25 'For best recording results, please run record_wpr with Python ' | 25 'For best recording results, please run record_wpr with Python ' |
26 'version 2.7.9 or after (See ' | 26 'version 2.7.9 or after (See ' |
27 'https://github.com/chromium/web-page-replay/issues/73 ' | 27 'https://github.com/chromium/web-page-replay/issues/73 ' |
28 'for more information).')) | 28 'for more information).\n' |
29 | 29 'For instructions on how to upgrade Python on Ubuntu 14.04, see:\n' |
30 print ('For instructions on how to upgrade Python on Ubuntu 14.04, see:\n' | 30 'http://mbless.de/blog/2016/01/09/upgrade-to-python-2711-on-ubuntu-140
4-lts.html')) |
31 'http://mbless.de/blog/2016/01/09/upgrade-to-python-2711-on-ubuntu-1404
-lts.html') | |
32 | 31 |
33 | 32 |
34 if __name__ == '__main__': | 33 if __name__ == '__main__': |
35 if sys.version_info < (2, 7, 9): | 34 if sys.version_info < (2, 7, 9): |
36 _WarnPythonVersion() | 35 _WarnPythonVersion() |
37 sys.exit(record_wpr.Main(environment=chromium_config.ChromiumConfig())) | 36 sys.exit(record_wpr.Main(environment=chromium_config.ChromiumConfig())) |
OLD | NEW |