create options files on WebHost startup

This commit is contained in:
Fabian Dill
2021-07-22 18:21:31 +02:00
parent df9bad75ea
commit 34ff5d9662
5 changed files with 120 additions and 21 deletions

View File

@@ -12,6 +12,7 @@ from waitress import serve
from WebHostLib.models import db
from WebHostLib.autolauncher import autohost
from WebHostLib.lttpsprites import update_sprites_lttp
from WebHostLib.options import create as create_options_files
configpath = os.path.abspath("config.yaml")
@@ -33,6 +34,7 @@ if __name__ == "__main__":
logging.basicConfig(format='[%(asctime)s] %(message)s', level=logging.INFO)
update_sprites_lttp()
app = get_app()
create_options_files()
if app.config["SELFLAUNCH"]:
autohost(app.config)
if app.config["SELFHOST"]: # using WSGI, you just want to run get_app()