python-gallery/setup/runner.py
Michał 36a7f83db6 Follow DeepSource reccommendations
Nolonger binding to the address, by default it is always localhost
2023-04-02 23:20:34 +00:00

34 lines
828 B
Python

"""
Gunicorn configuration file
"""
from gunicorn.app.base import Application
from gunicorn import util
class OnlyLegs(Application):
"""
Gunicorn application
"""
def __init__(self, options={}): # pylint: disable=W0102, W0231
self.usage = None
self.callable = None
self.options = options
self.do_load_config()
def init(self, *args):
"""
Initialize the application
"""
cfg = {}
for setting, value in self.options.items():
if setting.lower() in self.cfg.settings and value is not None:
cfg[setting.lower()] = value
return cfg
@staticmethod
def prog(self): # pylint: disable=C0116, E0202
return 'OnlyLegs'
def load(self):
return util.import_app('gallery:create_app()')