Example #1
0
 def run(self, listen_addr='0.0.0.0', listen_port=8081):
     """
     Start the webserver on address `listen_addr` and port `listen_port`.
     This call is blocking until the user hits Ctrl-c, the shutdown() method
     is called or something like SystemExit is raised in a handler.
     """
     ScriptFormWebApp.scriptform = self
     self.httpd = ThreadedHTTPServer((listen_addr, listen_port),
                                     ScriptFormWebApp)
     self.httpd.daemon_threads = True
     self.log.info("Listening on %s:%s", listen_addr, listen_port)
     self.running = True
     self.httpd.serve_forever()
     self.running = False