OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import os | 5 import os |
6 import sys | 6 import sys |
7 | 7 |
8 sys.path.insert(1, os.path.join(os.path.abspath(__file__), '..', '..')) | 8 sys.path.insert(1, os.path.join(os.path.abspath(__file__), '..', '..')) |
9 | 9 |
10 from chrome_telemetry_build import chromium_config | 10 from chrome_telemetry_build import chromium_config |
11 | 11 |
12 | 12 |
13 def GetChromiumSrcDir(): | 13 def GetChromiumSrcDir(): |
14 return chromium_config.GetChromiumSrcDir() | 14 return chromium_config.GetChromiumSrcDir() |
15 | 15 |
16 | 16 |
17 def GetCatapultBaseDir(): | |
18 return os.path.join( | |
19 GetChromiumSrcDir(), 'third_party', 'catapult', 'catapult_base') | |
20 | |
21 | 17 |
22 def GetTelemetryDir(): | 18 def GetTelemetryDir(): |
23 return chromium_config.GetTelemetryDir() | 19 return chromium_config.GetTelemetryDir() |
24 | 20 |
25 | 21 |
26 def GetPerfDir(): | 22 def GetPerfDir(): |
27 return os.path.join(GetChromiumSrcDir(), 'tools', 'perf') | 23 return os.path.join(GetChromiumSrcDir(), 'tools', 'perf') |
28 | 24 |
29 | 25 |
30 def GetPerfStorySetsDir(): | 26 def GetPerfStorySetsDir(): |
31 return os.path.join(GetPerfDir(), 'page_sets') | 27 return os.path.join(GetPerfDir(), 'page_sets') |
32 | 28 |
33 | 29 |
34 def GetPerfBenchmarksDir(): | 30 def GetPerfBenchmarksDir(): |
35 return os.path.join(GetPerfDir(), 'benchmarks') | 31 return os.path.join(GetPerfDir(), 'benchmarks') |
36 | 32 |
37 | 33 |
38 def AddTelemetryToPath(): | 34 def AddTelemetryToPath(): |
39 telemetry_path = GetTelemetryDir() | 35 telemetry_path = GetTelemetryDir() |
40 if telemetry_path not in sys.path: | 36 if telemetry_path not in sys.path: |
41 sys.path.insert(1, telemetry_path) | 37 sys.path.insert(1, telemetry_path) |
42 | 38 |
43 | 39 |
44 def AddCatapultBaseToPath(): | 40 def AddPyUtilsToPath(): |
45 catapult_base_path = GetCatapultBaseDir() | 41 py_utils_dir = os.path.join( |
46 if catapult_base_path not in sys.path: | 42 GetChromiumSrcDir(), 'third_party', 'catapult', 'common', 'py_utils') |
47 sys.path.insert(1, catapult_base_path) | 43 if py_utils_dir not in sys.path: |
| 44 sys.path.insert(1, py_utils_dir) |
OLD | NEW |