Skip to content
Snippets Groups Projects
Verified Commit 18422b41 authored by TheJoeCoder's avatar TheJoeCoder
Browse files

Fix my mistakes

parent f8bd2b11
Branches
No related tags found
No related merge requests found
...@@ -16,11 +16,11 @@ default_config = { ...@@ -16,11 +16,11 @@ default_config = {
} }
config = default_config.copy() config = default_config.copy()
if os.path.exists("config.json"): if os.path.exists("hw_config.json"):
with open("config.json", "r") as f: with open("hw_config.json", "r") as f:
config.update(json.load(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) json.dump(config, f, indent=4)
PROP_SCREEN_WIDTH = config["screen_width"] PROP_SCREEN_WIDTH = config["screen_width"]
......
...@@ -91,6 +91,10 @@ def wr_set_pattern(): ...@@ -91,6 +91,10 @@ def wr_set_pattern():
def wr_get_config(): def wr_get_config():
return Response(json.dumps(module_config), mimetype="application/json") 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): def load_widget(widget_name: str):
# Get the widget properties from the config file # Get the widget properties from the config file
widget_props = module_config.get(widget_name, {}).copy() widget_props = module_config.get(widget_name, {}).copy()
...@@ -114,6 +118,7 @@ def run_screen(): ...@@ -114,6 +118,7 @@ def run_screen():
# Initialise Pygame and create a window # Initialise Pygame and create a window
pygame.init() pygame.init()
pg_options = 0x0 pg_options = 0x0
print(PROP_WINDOW_FULLSCREEN)
if PROP_WINDOW_FULLSCREEN: if PROP_WINDOW_FULLSCREEN:
pg_options |= pygame.FULLSCREEN pg_options |= pygame.FULLSCREEN
screen = pygame.display.set_mode( screen = pygame.display.set_mode(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment