python-gallery/setup/runner.py

24 lines
592 B
Python
Raw Normal View History

2023-03-12 15:08:49 +00:00
from gunicorn.app.base import Application
from gunicorn import util
2023-03-12 18:53:57 +00:00
2023-03-12 15:08:49 +00:00
class OnlyLegs(Application):
def __init__(self, options={}):
self.usage = None
self.callable = None
self.options = options
self.do_load_config()
def init(self, *args):
cfg = {}
for k, v in self.options.items():
if k.lower() in self.cfg.settings and v is not None:
cfg[k.lower()] = v
return cfg
def prog(self):
return 'OnlyLegs'
def load(self):
return util.import_app('gallery:create_app()')