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