def run(self, handler): from eventlet import wsgi, listen try: wsgi.server(listen((self.host, self.port)), handler, log_output=(not self.quiet)) except TypeError: # Fallback, if we have old version of eventlet wsgi.server(listen((self.host, self.port)), handler)
def run(self, handler): from eventlet import wsgi, listen try: wsgi.server(listen((self.host, self.port)), handler, log_output=(not self.quiet)) except TypeError: # Needed to ignore the log class NoopLog: def write(self, *args): pass # Fallback, if we have old version of eventlet wsgi.server(listen((self.host, self.port)), handler, log=NoopLog())
def run(self, handler): from eventlet import wsgi, listen, patcher if not patcher.is_monkey_patched(os): msg = "Bottle requires eventlet.monkey_patch() (before import)" raise RuntimeError(msg) socket_args = {} for arg in ('backlog', 'family'): try: socket_args[arg] = self.options.pop(arg) except KeyError: pass address = (self.host, self.port) try: wsgi.server(listen(address, **socket_args), handler, log_output=(not self.quiet)) except TypeError: # Fallback, if we have old version of eventlet wsgi.server(listen(address), handler)
def run(self, handler): from eventlet import wsgi, listen wsgi.server(listen((self.host, self.port)), handler)
def eventlet(app, address, **options): from eventlet import wsgi, listen wsgi.server(listen(address), app)
def eventlet(app, address, **options): from gevent import monkey monkey.patch_all() from eventlet import wsgi, listen wsgi.server(listen(address), app)