mirror of https://gitlab.com/litecord/litecord.git
manage: make FakeApp.config be the same thing as Quart.config
This commit is contained in:
parent
c44e184e6e
commit
78b45b022a
|
|
@ -79,9 +79,13 @@ def init_parser():
|
||||||
def main(config):
|
def main(config):
|
||||||
"""Start the script"""
|
"""Start the script"""
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
# TODO make cfg import from Quart.config.from_object
|
|
||||||
cfg = getattr(config, config.MODE)
|
# by doing this we can "import" quart's default config keys,
|
||||||
app = FakeApp(cfg.__dict__)
|
# like SERVER_NAME, required for app_context to work.
|
||||||
|
quart_app = Quart(__name__)
|
||||||
|
quart_app.config.from_object(f"config.{config.MODE}")
|
||||||
|
|
||||||
|
app = FakeApp(quart_app.config)
|
||||||
parser = init_parser()
|
parser = init_parser()
|
||||||
|
|
||||||
loop.run_until_complete(init_app_db(app))
|
loop.run_until_complete(init_app_db(app))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue