Exemple #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
Exemple #2
0
 def __init__(self, app, port, **kwargs):
   self.app = app
   self.port = port
   self.opts = kwargs
   Application.__init__(self)
Exemple #3
0
 def __init__(self, app, options=None):
     self.options = options or {}
     self.app = app
     Application.__init__(self, None)
Exemple #4
0
 def __init__(self, app):
     Application.__init__(self)
     self.cfg = None
     self.log = None
     self.app = app
Exemple #5
0
    def run(self, **options):
        self.cfg = Config()
        for key, value in options.items():
            self.cfg.set(key, value)

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