diff --git a/.gitignore b/.gitignore index e374a12954aa..f4bcd35c32ae 100644 --- a/.gitignore +++ b/.gitignore @@ -33,11 +33,14 @@ setups build bundle/components.wxs dist +/prof/ README.html .vs/ EnemizerCLI/ /Players/ /SNI/ +/sni-*/ +/appimagetool* /host.yaml /options.yaml /config.yaml @@ -140,6 +143,7 @@ ipython_config.py .venv* env/ venv/ +/venv*/ ENV/ env.bak/ venv.bak/ diff --git a/WebHostLib/misc.py b/WebHostLib/misc.py index 6d3e82c00c6d..e3111ed5b53c 100644 --- a/WebHostLib/misc.py +++ b/WebHostLib/misc.py @@ -32,29 +32,34 @@ def page_not_found(err): # Start Playing Page @app.route('/start-playing') +@cache.cached() def start_playing(): return render_template(f"startPlaying.html") @app.route('/weighted-settings') +@cache.cached() def weighted_settings(): return render_template(f"weighted-settings.html") # Player settings pages @app.route('/games//player-settings') +@cache.cached() def player_settings(game): return render_template(f"player-settings.html", game=game, theme=get_world_theme(game)) # Game Info Pages @app.route('/games//info/') +@cache.cached() def game_info(game, lang): return render_template('gameInfo.html', game=game, lang=lang, theme=get_world_theme(game)) # List of supported games @app.route('/games') +@cache.cached() def games(): worlds = {} for game, world in AutoWorldRegister.world_types.items(): @@ -64,21 +69,25 @@ def games(): @app.route('/tutorial///') +@cache.cached() def tutorial(game, file, lang): return render_template("tutorial.html", game=game, file=file, lang=lang, theme=get_world_theme(game)) @app.route('/tutorial/') +@cache.cached() def tutorial_landing(): return render_template("tutorialLanding.html") @app.route('/faq//') +@cache.cached() def faq(lang): return render_template("faq.html", lang=lang) @app.route('/glossary//') +@cache.cached() def terms(lang): return render_template("glossary.html", lang=lang) @@ -147,7 +156,7 @@ def host_room(room: UUID): @app.route('/favicon.ico') def favicon(): - return send_from_directory(os.path.join(app.root_path, 'static/static'), + return send_from_directory(os.path.join(app.root_path, "static", "static"), 'favicon.ico', mimetype='image/vnd.microsoft.icon') @@ -167,6 +176,7 @@ def get_datapackage(): @app.route('/index') @app.route('/sitemap') +@cache.cached() def get_sitemap(): available_games: List[Dict[str, Union[str, bool]]] = [] for game, world in AutoWorldRegister.world_types.items(): diff --git a/WebHostLib/requirements.txt b/WebHostLib/requirements.txt index a3695e338301..55669f1018bc 100644 --- a/WebHostLib/requirements.txt +++ b/WebHostLib/requirements.txt @@ -1,6 +1,5 @@ flask>=2.2.3 -pony>=0.7.16; python_version <= '3.10' -pony @ https://github.com/Berserker66/pony/releases/download/v0.7.16/pony-0.7.16-py3-none-any.whl#0.7.16 ; python_version >= '3.11' +pony>=0.7.17 waitress>=2.1.2 Flask-Caching>=2.0.2 Flask-Compress>=1.14 diff --git a/WebHostLib/templates/viewSeed.html b/WebHostLib/templates/viewSeed.html index e252fb06a28b..a8478c95c30d 100644 --- a/WebHostLib/templates/viewSeed.html +++ b/WebHostLib/templates/viewSeed.html @@ -34,7 +34,7 @@

Seed Info

{% endif %} Rooms:  - + {% call macros.list_rooms(seed.rooms | selectattr("owner", "eq", session["_id"])) %}
  • Create New Room diff --git a/kvui.py b/kvui.py index 835f0dad45f4..71bf80c86d9b 100644 --- a/kvui.py +++ b/kvui.py @@ -7,7 +7,10 @@ import ctypes # kivy 2.2.0 introduced DPI awareness on Windows, but it makes the UI enter an infinitely recursive re-layout # by setting the application to not DPI Aware, Windows handles scaling the entire window on its own, ignoring kivy's - ctypes.windll.shcore.SetProcessDpiAwareness(0) + try: + ctypes.windll.shcore.SetProcessDpiAwareness(0) + except FileNotFoundError: # shcore may not be found on <= Windows 7 + pass # TODO: remove silent except when Python 3.8 is phased out. os.environ["KIVY_NO_CONSOLELOG"] = "1" os.environ["KIVY_NO_FILELOG"] = "1"