Example #1
0
 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)
Example #2
0
    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())
Example #3
0
    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())
Example #4
0
 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)
Example #5
0
 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)
Example #7
0
 def eventlet(app, address, **options):
     from eventlet import wsgi, listen
     wsgi.server(listen(address), app)
Example #8
0
 def run(self, handler):
     from eventlet import wsgi, listen
     wsgi.server(listen((self.host, self.port)), handler)
Example #9
0
 def eventlet(app, address, **options):
     from gevent import monkey
     monkey.patch_all()
     from eventlet import wsgi, listen
     wsgi.server(listen(address), app)
Example #10
0
 def eventlet(app, address, **options):
     from gevent import monkey
     monkey.patch_all()
     from eventlet import wsgi, listen
     wsgi.server(listen(address), app)