1 # Copyright (c) 2012 The Chromium OS 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.
8 # Add the third_party/ dir to our search path so that we can find the
9 # modules in there automatically. This isn't normal, so don't replicate
10 # this pattern elsewhere.
11 _chromite_dir = os.path.normpath(os.path.dirname(os.path.realpath(__file__)))
12 _containing_dir = os.path.dirname(_chromite_dir)
13 _third_party_dirs = [os.path.join(_chromite_dir, 'third_party')]
14 # If chromite is living inside the Chrome checkout under
15 # <chrome_root>/src/third_party/chromite, its dependencies will be checked out
16 # to <chrome_root>/src/third_party instead of the normal chromite/third_party
17 # location due to git-submodule limitations (a submodule cannot be contained
18 # inside another submodule's workspace), so we want to add that to the
20 if os.path.basename(_containing_dir) == 'third_party':
21 _third_party_dirs.append(_containing_dir)
23 # List of third_party packages that might need subpaths added to search.
25 os.path.join('gdata', 'src'),
31 for _third_party in _third_party_dirs[:]:
32 _component = os.path.join(_third_party, _path)
33 if os.path.isdir(_component):
34 _third_party_dirs.append(_component)
35 sys.path = _third_party_dirs + sys.path