예제 #1
0
 def __init__(self,
              *args,
              gunicorn_cfg: ConfigDict = None,
              log_cfg: ConfigDict = None,
              **kwargs):
     self._log_cfg = log_cfg
     self._cfg = gunicorn_cfg or {}
     self._cfg.setdefault('worker_class', 'gevent')
     self._cfg.setdefault('workers', 1)
     self.__on_starting = self._cfg.get('on_starting')
     self._cfg['on_starting'] = self._on_starting
     if log_cfg:
         self._cfg['post_fork'] = self._init_logging
     FlaskServer.__init__(self, *args, **kwargs)
     Application.__init__(self)
     self._arbiter = None
예제 #2
0
 def __init__(self, app, port, **kwargs):
   self.app = app
   self.port = port
   self.opts = kwargs
   Application.__init__(self)
예제 #3
0
파일: app.py 프로젝트: yadihaoku/redis-ctl
 def __init__(self, app, options=None):
     self.options = options or {}
     self.app = app
     Application.__init__(self, None)
예제 #4
0
 def __init__(self, app):
     Application.__init__(self)
     self.cfg = None
     self.log = None
     self.app = app
예제 #5
0
    def run(self, **options):
        self.cfg = Config()
        for key, value in options.items():
            self.cfg.set(key, value)

        return Application.run(self)
예제 #6
0
 def run(self, **options):
     self.cfg = Config()
     [self.cfg.set(key, value) for key, value in options.items()]
     return Application.run(self)