Skip to content

Commit

Permalink
Remove old Gunicorn support and change app() to handler.
Browse files Browse the repository at this point in the history
  • Loading branch information
iurisilvio committed Sep 18, 2011
1 parent 6648946 commit 2495898
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions bottle.py
Expand Up @@ -2074,27 +2074,18 @@ def run(self, handler):
class GunicornServer(ServerAdapter):
""" Untested. """
def run(self, handler):
from gunicorn import version_info
from gunicorn.app.base import Application

config = {'bind': "%s:%d" % (self.host, int(self.port)), 'workers': 4}

if version_info < (0, 9, 0):
from gunicorn.arbiter import Arbiter
from gunicorn.config import Config

arbiter = Arbiter(Config(config), app())
arbiter.run()
else:
from gunicorn.app.base import Application

class GunicornApplication(Application):
def init(_self, parser, opts, args):
return config
class GunicornApplication(Application):
def init(_self, parser, opts, args):
return config

def load(self):
return app()
def load(self):
return handler

GunicornApplication().run()
GunicornApplication().run()


class EventletServer(ServerAdapter):
Expand Down

0 comments on commit 2495898

Please sign in to comment.