OLD | NEW |
(Empty) | |
| 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 |
| 3 # found in the LICENSE file. |
| 4 |
| 5 # All files in this directory should be moved to catapult/base/ after moving |
| 6 # to the new repo. |
| 7 |
| 8 import os |
| 9 import sys |
| 10 |
| 11 from catapult_base import util |
| 12 |
| 13 def _AddDirToPythonPath(*path_parts): |
| 14 path = os.path.abspath(os.path.join(*path_parts)) |
| 15 if os.path.isdir(path) and path not in sys.path: |
| 16 # Some callsite that use telemetry assumes that sys.path[0] is the directory |
| 17 # containing the script, so we add these extra paths to right after it. |
| 18 sys.path.insert(1, path) |
| 19 |
| 20 _AddDirToPythonPath(os.path.join(util.GetCatapultDir(), 'third_party', 'mock')) |
| 21 _AddDirToPythonPath(os.path.join(util.GetCatapultDir(), 'third_party', 'mox3')) |
| 22 _AddDirToPythonPath( |
| 23 os.path.join(util.GetCatapultDir(), 'third_party', 'pyfakefs')) |
OLD | NEW |