mirroring: Fix import by putting 'api' path first

(imported from commit b35d962d6456f01b97deeeaa328faa03b65494f8)
This commit is contained in:
Keegan McAllister 2012-12-03 17:13:41 -05:00
parent ac9e3d6483
commit b971ce4683
2 changed files with 8 additions and 4 deletions

View file

@ -26,7 +26,10 @@ parser.add_option('--root-path',
action='store') action='store')
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
sys.path[:0] = [os.path.join(options.root_path, "python-zephyr"), # The 'api' directory needs to go first, so that 'import humbug' won't pick up
# some other directory named 'humbug'.
sys.path[:0] = [os.path.join(options.root_path, "api/"),
os.path.join(options.root_path, "python-zephyr"),
os.path.join(options.root_path, "python-zephyr/build/lib.linux-x86_64-2.6/"), os.path.join(options.root_path, "python-zephyr/build/lib.linux-x86_64-2.6/"),
options.root_path] options.root_path]
@ -34,7 +37,6 @@ mit_user = 'tabbott/extra@ATHENA.MIT.EDU'
humbug_user = 'tabbott/extra@mit.edu' humbug_user = 'tabbott/extra@mit.edu'
sys.path.append(".") sys.path.append(".")
sys.path.append(path.join(path.dirname(__file__), '..'))
import humbug import humbug
humbug_client = humbug.Client( humbug_client = humbug.Client(
email=humbug_user, email=humbug_user,

View file

@ -774,8 +774,10 @@ if __name__ == "__main__":
(options, args) = parse_args() (options, args) = parse_args()
sys.path[:0] = [options.root_path, # The 'api' directory needs to go first, so that 'import humbug' won't pick
os.path.join(options.root_path, 'api'), # up some other directory named 'humbug'.
sys.path[:0] = [os.path.join(options.root_path, 'api'),
options.root_path,
os.path.join(options.root_path, "python-zephyr"), os.path.join(options.root_path, "python-zephyr"),
os.path.join(options.root_path, "python-zephyr/build/lib.linux-x86_64-2.6/")] os.path.join(options.root_path, "python-zephyr/build/lib.linux-x86_64-2.6/")]