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 | 8 |
9 CATAPULT_PATH = os.path.dirname(os.path.dirname(os.path.dirname( | 9 CATAPULT_PATH = os.path.dirname(os.path.dirname(os.path.dirname( |
10 os.path.abspath(__file__)))) | 10 os.path.abspath(__file__)))) |
11 CATAPULT_THIRD_PARTY_PATH = os.path.join(CATAPULT_PATH, 'third_party') | 11 CATAPULT_THIRD_PARTY_PATH = os.path.join(CATAPULT_PATH, 'third_party') |
12 DEPENDENCY_MANAGER_PATH = os.path.join(CATAPULT_PATH, 'dependency_manager') | 12 DEPENDENCY_MANAGER_PATH = os.path.join(CATAPULT_PATH, 'dependency_manager') |
13 | 13 |
14 | 14 |
15 def _AddDirToPythonPath(*path_parts): | 15 def _AddDirToPythonPath(*path_parts): |
16 path = os.path.abspath(os.path.join(*path_parts)) | 16 path = os.path.abspath(os.path.join(*path_parts)) |
17 if os.path.isdir(path) and path not in sys.path: | 17 if os.path.isdir(path) and path not in sys.path: |
18 sys.path.append(path) | 18 sys.path.append(path) |
19 | 19 |
20 | 20 |
21 _AddDirToPythonPath(CATAPULT_PATH, 'common', 'py_utils') | 21 _AddDirToPythonPath(CATAPULT_PATH, 'common', 'py_utils') |
22 _AddDirToPythonPath(CATAPULT_THIRD_PARTY_PATH, 'mock') | 22 _AddDirToPythonPath(CATAPULT_THIRD_PARTY_PATH, 'mock') |
23 _AddDirToPythonPath(CATAPULT_THIRD_PARTY_PATH, 'pyfakefs') | 23 _AddDirToPythonPath(CATAPULT_THIRD_PARTY_PATH, 'pyfakefs') |
| 24 _AddDirToPythonPath(CATAPULT_THIRD_PARTY_PATH, 'zipfile') |
24 _AddDirToPythonPath(DEPENDENCY_MANAGER_PATH) | 25 _AddDirToPythonPath(DEPENDENCY_MANAGER_PATH) |
25 | 26 |
26 | 27 |
27 # pylint: disable=unused-import | 28 # pylint: disable=unused-import |
28 from .archive_info import ArchiveInfo | 29 from .archive_info import ArchiveInfo |
29 from .base_config import BaseConfig | 30 from .base_config import BaseConfig |
30 from .cloud_storage_info import CloudStorageInfo | 31 from .cloud_storage_info import CloudStorageInfo |
31 from .dependency_info import DependencyInfo | 32 from .dependency_info import DependencyInfo |
32 from .exceptions import CloudStorageError | 33 from .exceptions import CloudStorageError |
33 from .exceptions import CloudStorageUploadConflictError | 34 from .exceptions import CloudStorageUploadConflictError |
34 from .exceptions import EmptyConfigError | 35 from .exceptions import EmptyConfigError |
35 from .exceptions import FileNotFoundError | 36 from .exceptions import FileNotFoundError |
36 from .exceptions import NoPathFoundError | 37 from .exceptions import NoPathFoundError |
37 from .exceptions import ReadWriteError | 38 from .exceptions import ReadWriteError |
38 from .exceptions import UnsupportedConfigFormatError | 39 from .exceptions import UnsupportedConfigFormatError |
39 from .local_path_info import LocalPathInfo | 40 from .local_path_info import LocalPathInfo |
40 from .manager import DependencyManager | 41 from .manager import DependencyManager |
41 # pylint: enable=unused-import | 42 # pylint: enable=unused-import |
42 | 43 |
OLD | NEW |