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