From 18422b414caee77946cd3dbedbde070e0d64eb75 Mon Sep 17 00:00:00 2001 From: TheJoeCoder <joe@radialbog9.uk> Date: Tue, 24 Sep 2024 11:46:21 +0100 Subject: [PATCH] Fix my mistakes --- config.py | 6 +++--- main.py | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/config.py b/config.py index 19dfd5c..22c74b1 100644 --- a/config.py +++ b/config.py @@ -16,11 +16,11 @@ default_config = { } config = default_config.copy() -if os.path.exists("config.json"): - with open("config.json", "r") as f: +if os.path.exists("hw_config.json"): + with open("hw_config.json", "r") as f: config.update(json.load(f)) -with open("config.json", "w") as f: +with open("hw_config.json", "w") as f: json.dump(config, f, indent=4) PROP_SCREEN_WIDTH = config["screen_width"] diff --git a/main.py b/main.py index f755a29..6b021ad 100644 --- a/main.py +++ b/main.py @@ -91,6 +91,10 @@ def wr_set_pattern(): def wr_get_config(): return Response(json.dumps(module_config), mimetype="application/json") +@app.route("/api/test") +def wr_test(): + print(request.json) + def load_widget(widget_name: str): # Get the widget properties from the config file widget_props = module_config.get(widget_name, {}).copy() @@ -114,6 +118,7 @@ def run_screen(): # Initialise Pygame and create a window pygame.init() pg_options = 0x0 + print(PROP_WINDOW_FULLSCREEN) if PROP_WINDOW_FULLSCREEN: pg_options |= pygame.FULLSCREEN screen = pygame.display.set_mode( -- GitLab