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

Unified Diff: scripts/bootstrap/frog_wrapper.py

Issue 8437081: Frog changes (in experimental) to get frog integrated into the test infrastructure. (Closed) Base URL: http://dart.googlecode.com/svn/experimental/frog/
Patch Set: '' Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: scripts/bootstrap/frog_wrapper.py
===================================================================
--- scripts/bootstrap/frog_wrapper.py (revision 1140)
+++ scripts/bootstrap/frog_wrapper.py (working copy)
@@ -3,19 +3,34 @@
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
+import imp
import os
import sys
-HOME = os.path.dirname(os.path.realpath(__file__))
-# TODO(ngeoffray): does not work on Windows.
-HOME = os.path.join(HOME, os.pardir, os.pardir)
+def main(args):
+ # Try to find frog.py from the current location.
+ home = os.path.join(os.curdir, 'frog.py')
+ if not os.path.exists(home):
+ home = os.path.join(os.curdir, 'frog', 'frog.py')
-sys.path.append(HOME)
-import frog
+ if not os.path.exists(home):
+ print "Could not find frog"
+ return 1
-def main(args):
- return frog.main(args)
+ filename = None
+ exit_code = 1
+ try:
+ # Load frog.py and invoke it.
+ paths = [os.path.dirname(home)]
+ (filename, pathname, description) = imp.find_module('frog', paths)
+ module = imp.load_module('frog', filename, pathname, description)
+ exit_code = module.main(args)
+ finally:
+ if filename:
+ filename.close()
+ return exit_code
+
if __name__ == '__main__':
sys.exit(main(sys.argv))

Powered by Google App Engine
This is Rietveld 408576698