This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
2014-06-13 13:52:18 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
""" Script to launch mandaye with gunicorn server
|
|
|
|
"""
|
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
|
|
|
from gunicorn.app.wsgiapp import WSGIApplication
|
|
|
|
|
|
|
|
class MandayeWSGIApplication(WSGIApplication):
|
|
|
|
|
|
|
|
def init(self, parser, opts, args):
|
|
|
|
self.cfg.set("default_proc_name", "mandaye_cud.wsgi:application_dev")
|
|
|
|
self.app_uri = "mandaye_cud.wsgi:application_dev"
|
|
|
|
|
|
|
|
def main():
|
|
|
|
""" The ``gunicorn`` command line runner for launcing Gunicorn with
|
|
|
|
generic WSGI applications.
|
|
|
|
"""
|
2014-10-27 18:01:41 +01:00
|
|
|
config_file = None
|
|
|
|
config_arg_pos = None
|
|
|
|
for i, arg in enumerate(sys.argv[1:]):
|
|
|
|
if arg.startswith('--config='):
|
|
|
|
config_file = arg.split('=')[1]
|
|
|
|
config_arg_pos = i
|
|
|
|
if config_file:
|
|
|
|
os.environ['MANDAYE_CONFIG_FILES'] = config_file
|
|
|
|
if config_arg_pos is not None:
|
|
|
|
del sys.argv[config_arg_pos + 1]
|
2014-06-13 13:52:18 +02:00
|
|
|
MandayeWSGIApplication("%(prog)s [OPTIONS]").run()
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|
|
|
|
|