From d35adc58680122d8b677232c0bfda5e7de7ed583 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Thu, 13 May 2021 00:28:53 +0200 Subject: [PATCH] Update Flask and Jinja Flask Autoversion is now integrated Flask config.from_file is now integrated --- WebHost.py | 6 ++---- WebHostLib/__init__.py | 4 ---- WebHostLib/requirements.txt | 3 +-- requirements.txt | 4 ++-- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/WebHost.py b/WebHost.py index ce42fcd8a005..92e57d0d03b7 100644 --- a/WebHost.py +++ b/WebHost.py @@ -8,16 +8,14 @@ from WebHostLib.models import db from WebHostLib.autolauncher import autohost -configpath = "config.yaml" +configpath = os.path.abspath("config.yaml") def get_app(): app = raw_app if os.path.exists(configpath): import yaml - with open(configpath) as c: - app.config.update(yaml.safe_load(c)) - + app.config.from_file(configpath, yaml.safe_load) logging.info(f"Updated config from {configpath}") db.bind(**app.config["PONY"]) db.generate_mapping(create_tables=True) diff --git a/WebHostLib/__init__.py b/WebHostLib/__init__.py index 1f33dddc7d53..a6c030759c27 100644 --- a/WebHostLib/__init__.py +++ b/WebHostLib/__init__.py @@ -6,7 +6,6 @@ from pony.flask import Pony from flask import Flask, request, redirect, url_for, render_template, Response, session, abort, send_from_directory from flask_caching import Cache -from flaskext.autoversion import Autoversion from flask_compress import Compress from .models import * @@ -48,9 +47,6 @@ app.config["JSON_AS_ASCII"] = False app.config["PATCH_TARGET"] = "archipelago.gg" -app.autoversion = True - -av = Autoversion(app) cache = Cache(app) Compress(app) diff --git a/WebHostLib/requirements.txt b/WebHostLib/requirements.txt index 243f7603075f..5dc2308f0453 100644 --- a/WebHostLib/requirements.txt +++ b/WebHostLib/requirements.txt @@ -1,7 +1,6 @@ -flask>=1.1.2 +flask>=2.0.0 pony>=0.7.14 waitress>=2.0.0 flask-caching>=1.10.1 -Flask-Autoversion>=0.2.0 Flask-Compress>=1.9.0 Flask-Limiter>=1.4 diff --git a/requirements.txt b/requirements.txt index 5309b54015ed..87a0258cbc87 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ colorama>=0.4.4 -websockets>=8.1 +websockets>=9.0.1 PyYAML>=5.4.1 fuzzywuzzy>=0.18.0 bsdiff4>=1.2.1 @@ -8,4 +8,4 @@ appdirs>=1.4.4 maseya-z3pr>=1.0.0rc1 xxtea>=2.0.0.post0 factorio-rcon-py>=1.2.1 -jinja2>=2.11.3 \ No newline at end of file +jinja2>=3.0.0 \ No newline at end of file