From d3eb9ba991908e577ba26218749c9d13da4b530d Mon Sep 17 00:00:00 2001 From: Justin Date: Tue, 29 Aug 2023 19:06:56 +0800 Subject: [PATCH] added clock 1 2 worldclock settings --- server.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index ae357f3..9d332d2 100755 --- a/server.py +++ b/server.py @@ -404,6 +404,30 @@ def index(): clock_screensaver = {"clock1": {"time_color": "White", "weekday_color": "Cyan", "date_color": "Blue", "timezone": "Etc/GMT+4", "display_seconds": True, "display_pm": True, "12hour": True, "brightness": "10"}, "clock2": {"time_color": "Orange", "date_color": "White", "timezone": "Etc/GMT+4", "display_seconds": True, "display_pm": True, "12hour": True, "brightness": "10"}, "world_clock": {"city_color": "White", "display_seconds": True, "display_pm": True, "12hour": True, "brightness": "10"}} with open('clock_screensaver.json', 'w') as f: json.dump(clock_screensaver, f) + try: + f = open('clock1_settings.json', 'r') + clock1_settings = json.load(f) + f.close() + except: + clock1_settings = {"speed": "fast", "transition": "up", "pause": "20"} + with open('csv/clock1_settings.json', 'w') as f: + json.dump(clock1_settings, f) + try: + f = open('clock2_settings.json', 'r') + clock2_settings = json.load(f) + f.close() + except: + clock2_settings = {"speed": "fast", "transition": "up", "pause": "20"} + with open('csv/clock2_settings.json', 'w') as f: + json.dump(clock2_settings, f) + try: + f = open('worldclock_settings.json', 'r') + worldclock_settings = json.load(f) + f.close() + except: + worldclock_settings = {"speed": "fast", "transition": "up", "pause": "20"} + with open('csv/worldclock_settings.json', 'w') as f: + json.dump(worldclock_settings, f) try: f = open('csv/scheduler.json','r') scheduler_settings = json.load(f) @@ -491,7 +515,10 @@ def index(): 'market_settings':market_settings, 'sector_settings':sector_settings, 'networks_list': networks_list, - 'clock_screensaver': clock_screensaver + 'clock_screensaver': clock_screensaver, + 'clock1_settings': clock1_settings, + 'clock2_settings': clock2_settings, + 'worldclock_settings': worldclock_settings }