def __call__(self): if not os.path.exists(self.devtools_path): print "Error: devtools directory %s does not exist. Use 'ponyd update-devtools' to download a compatible version of Chrome Developer Tools." % self.devtools_path return if self.verbose: tornado.options.options.logging = 'debug' tornado.log.enable_pretty_logging(options=tornado.options.options) logger = logging.getLogger() logger.setLevel(logging.DEBUG) application = tornado.web.Application([ (r"/devtools/page/([0-9]*)/?", DevToolsHandler), (r"/lobby", LobbyHandler), (r"/device", DeviceHandler), (r"/devtools/(.*)", tornado.web.StaticFileHandler, {"path": self.devtools_path}), (r"/(.*)", tornado.web.StaticFileHandler, {"path": self.static_path, "default_filename": 'index.html'}), ]) print "PonyGateway starting. Listening on http://%s:%s" % (self.listen_interface, self.listen_port) bonjour.register_service(self.bonjour_name, "_ponyd._tcp", self.listen_port) application.listen(self.listen_port, self.listen_interface) ioloop = tornado.ioloop.IOLoop.instance() ioloop.start()
def __call__(self): if not os.path.exists(self.devtools_path): print "Error: devtools directory %s does not exist. Use 'ponyd update-devtools' to download a compatible version of Chrome Developer Tools." % self.devtools_path return if self.verbose: tornado.options.enable_pretty_logging() logger = logging.getLogger() logger.setLevel(logging.INFO) application = tornado.web.Application([ (r"/devtools/page/([0-9]*)/?", DevToolsHandler), (r"/lobby", LobbyHandler), (r"/device", DeviceHandler), (r"/devtools/(.*)", tornado.web.StaticFileHandler, { "path": self.devtools_path }), (r"/(.*)", tornado.web.StaticFileHandler, { "path": self.static_path, "default_filename": 'index.html' }), ]) print "PonyGateway starting. Listening on %s:%s" % ( self.listen_interface, self.listen_port) bonjour.register_service(self.bonjour_name, "_ponyd._tcp", self.listen_port) application.listen(self.listen_port, self.listen_interface) tornado.ioloop.IOLoop.instance().start()