From acd9fa09519bb55e1d3df137e2756ec40e533891 Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Tue, 17 Apr 2012 10:24:57 -0500 Subject: [PATCH] gunicorn? --- VERSION | 2 +- anyserver.py | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index e2b60510..95bfe674 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.7 (2012-04-17 10:01:57) dev +Version 1.99.7 (2012-04-17 10:24:27) dev diff --git a/anyserver.py b/anyserver.py index 5fee6191..bd2fc39e 100644 --- a/anyserver.py +++ b/anyserver.py @@ -125,8 +125,16 @@ class Servers: @staticmethod def gunicorn(app,address, **options): - import gunicorn.arbiter - gunicorn.arbiter.Arbiter(address, 4, app).run() + from gunicorn.app.base import Application + config = {'bind': "%s:%d" % address} + config.update(options) + class GunicornApplication(Application): + def init(self, parser, opts, args): + return config + def load(self): + return app + g = GunicornApplication() + g.run() @staticmethod def eventlet(app,address, **options): @@ -294,7 +302,6 @@ def main(): print 'starting %s on %s:%s...' % (options.server,options.ip,options.port) run(options.server,options.ip,options.port,logging=options.logging,profiler=options.profiler) - if __name__=='__main__': main()