1. Rune Halvorsen
  2. glueon2

Commits

Rune Halvorsen  committed de83be7

Support option for port to use for test server

  • Participants
  • Parent commits 3495718
  • Branches default

Comments (0)

Files changed (1)

File glueon.py

View file
     try:
         # we don't use werkzeugs wsgi server because it handles
         # keyboardinterrupt on its own. We want to do so ourselves.
-        httpd = make_server('', 8080, app, handler_class=SilentWSGIRequestHandler)
+        httpd = make_server('', options.port, app, handler_class=SilentWSGIRequestHandler)
         httpd.timeout = 0.5
         print >> sys.stderr, "Serving"
 
         if options.launch:
             browser = webbrowser.get(options.browser)
-            browser.open("http://localhost:8080")
+            browser.open("http://localhost:%s" % options.port)
 
         starttime = time.time()
         while True:
     parser.add_option("-w", "--watchdog", dest="timeout",
                       default=None, action="store", type="float",
                       help="How long to run the server before forcefully killing it.")
+
+    parser.add_option("-p", "--port", dest="port",
+                      default=9471, action="store", type="int",
+                      help="What port to run test server on. Default is 9471.")
+
+
     return parser