Commits

Rune Halvorsen committed 10b4259

Made launching default browser the normal behaviour

Comments (0)

Files changed (1)

 import uuid
 import sys
 import time
+import webbrowser
 from  optparse import OptionParser
 from wsgiref.simple_server import make_server, WSGIRequestHandler
 
 import anyjson
 
 from werkzeug import (Request, Response, ClosingIterator, wrap_file,
-                      secure_filename, SharedDataMiddleware)
+                      secure_filename, SharedDataMiddleware, redirect)
+
 
 from werkzeug.exceptions import HTTPException, NotFound
 from werkzeug.routing import Map, Rule
         return "/suite/" + self.testpath
 
     def index(self, request, logger):
+        return redirect(self.test_url)
+        
         s = """<!doctype html><h1>Test runner</h1><a href="/suite/%s">%s</a>""" % (self.testpath, self.testpath)
         return Response(s, mimetype='text/html')
 
         httpd.timeout = 0.5
         print >> sys.stderr, "Serving"
 
+        if options.launch:
+            webbrowser.open("http://localhost:8080")
+
         starttime = time.time()
         while True:
             httpd.handle_request()
                       default=False, action="store_true",
                       help="Show request log")
 
-    parser.add_option("-b", "--browser", dest="browsers",
-                      default=None, action="append",
-                      help="Launch one or more browsers and run tests in them")
+    parser.add_option("-d", "--dont-launch", dest="launch",
+                      default=True, action="store_false",
+                      help="Prevent glueon from launching a browser automatically to run tests")
 
     parser.add_option("-f", "--format", dest="format",
                       default="foo", action="store",