Commits

Anonymous committed 364ecf9

makr run gunicorn support pidfile

Comments (0)

Files changed (4)

 - ...
 
+0.6.4 (2011-3-11)
+-------------------
+
+- run_gunicorn can set pidfile
+
 0.6.3 (2011-2-26)
 -------------------
 
 # built documents.
 #
 # The short X.Y version.
-version = '0.6.3'
+version = '0.6.4'
 # The full version, including alpha/beta/rc tags.
-release = '0.6.3'
+release = '0.6.4'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.

flaskext/actions/server_actions.py

     return action
 
 def run_gunicorn_server(app):
-    def action(host=('h','127.0.0.1'),port=('p', 8000),workers=('w',4)):
+    def action(bind=('b','127.0.0.1:8000'),workers=('w',4),pid=('p','tmp/flask.pid')):
         """run application use gunicorn http server
         """
         from gunicorn import version_info
         if version_info < (0, 9, 0):
             from gunicorn.arbiter import Arbiter
             from gunicorn.config import Config
-            arbiter = Arbiter(Config({'bind': "%s:%d" % (host, int(port)),'workers': 4}), app)
+            arbiter = Arbiter(Config({'bind':bind,'workers': 4}), app)
             arbiter.run()
         else:
             from gunicorn.app.base import Application
             class FlaskApplication(Application):
                 def init(self, parser, opts, args):
                     return {
-                        'bind': '{0}:{1}'.format(host, port),
-                        'workers': 4
+                        'bind': bind,
+                        'workers': workers,
+                        'pidfile':pid,
                     }
                 
                 def load(self):
 
 setup(
     name='Flask-Actions',
-    version='0.6.3',
+    version='0.6.4',
     url='http://blog.flyzen.com',
     license='BSD',
     author='Young King',