added clock 1 2 worldclock settings

This commit is contained in:
Justin 2023-08-29 19:06:56 +08:00 committed by GitHub
parent 23f943d9b0
commit d3eb9ba991
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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"}} 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: with open('clock_screensaver.json', 'w') as f:
json.dump(clock_screensaver, 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: try:
f = open('csv/scheduler.json','r') f = open('csv/scheduler.json','r')
scheduler_settings = json.load(f) scheduler_settings = json.load(f)
@ -491,7 +515,10 @@ def index():
'market_settings':market_settings, 'market_settings':market_settings,
'sector_settings':sector_settings, 'sector_settings':sector_settings,
'networks_list': networks_list, 'networks_list': networks_list,
'clock_screensaver': clock_screensaver 'clock_screensaver': clock_screensaver,
'clock1_settings': clock1_settings,
'clock2_settings': clock2_settings,
'worldclock_settings': worldclock_settings
} }