Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: infra/ext/__init__.py

Issue 355153002: Refactor infra git libs and testing. (Closed) Base URL: https://chromium.googlesource.com/infra/infra@fake_testing_support
Patch Set: Change config ref to have a sandard naming scheme Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 def _add_ext_dirs_to_path(): 9 def _add_ext_dirs_to_path():
10 base = os.path.dirname(os.path.abspath(__file__)) 10 base = os.path.dirname(os.path.abspath(__file__))
11 11
12 for d in os.listdir(base): 12 for d in os.listdir(base):
13 full = os.path.join(base, d) 13 full = os.path.join(base, d)
14 if os.path.isdir(full): 14 if os.path.isdir(full):
15 # TODO(iannucci): look for egg 15 # TODO(iannucci): look for egg
16 sys.path.insert(0, full) 16 sys.path.insert(0, full)
17 globals()[d] = __import__(d) 17 globals()[d] = __import__(d)
18 18
19 _add_ext_dirs_to_path() 19 _add_ext_dirs_to_path()
20 20
21 # Enough of a hint for pylint / jedi (autocompletion) to find and follow the 21 # Enough of a hint for pylint / jedi (autocompletion) to find and follow the
22 # imports, but doesn't make python import them immediately at runtime. 22 # imports, but doesn't make python import them immediately at runtime.
23 # 23 #
24 # This list should always contain a complete list of all modules in ext. 24 # This list should always contain a complete list of all modules in ext.
25 if False: 25 if False:
26 import argcomplete 26 import argcomplete
Vadim Sh. 2014/06/30 17:24:12 btw, you use yaml. Is pyyaml in ext?
iannucci 2014/06/30 23:03:03 No not yet :(. I want to add it, but there are too
27 import dateutil 27 import dateutil
28 import httplib2 28 import httplib2
29 import oauth2client 29 import oauth2client
30 import pytz 30 import pytz
31 import requests 31 import requests
32 import testing_support 32 import testing_support
33 33
34 34
35 class _LazyImportHack(object): 35 class _LazyImportHack(object):
36 __path__ = []
36 37
37 def __getattr__(self, name): 38 def __getattr__(self, name):
38 mod = __import__(name) 39 mod = __import__(name)
39 setattr(self, name, mod) 40 setattr(self, name, mod)
40 return mod 41 return mod
41 42
42 sys.modules[__name__] = _LazyImportHack() 43 sys.modules[__name__] = _LazyImportHack()
OLDNEW
« no previous file with comments | « .coveragerc ('k') | infra/libs/decorators/__init__.py » ('j') | infra/libs/types/__init__.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698