added clock settings from json file

This commit is contained in:
Justin 2023-08-22 21:20:54 +08:00 committed by GitHub
parent 5e366456e3
commit 28675fc75c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -395,6 +395,14 @@ def index():
sector_settings = {"feature": "Sector Performance", "speed": "medium", "speed2": "medium", "animation": "up", "logos": True, "title": True, "sectors": ["Energy", "Financials", "Real Estate", "Technology"], "data": {}}
with open('csv/sector_settings.json', 'w') as f:
json.dump(sector_settings, f)
try:
f = open('clock_screensaver.json', 'r')
clock_screensaver = json.load(f)
f.close()
except:
clock_screensaver = {"clock1": {"time_color": "White", "weekday_color": "Cyan", "date_color": "Blue", "timezone": "Asia/Tokyo", "display_seconds": True, "display_pm": True, "12hour": True}, "clock2": {"time_color": "Orange", "date_color": "White", "timezone": "Asia/Tokyo", "display_seconds": True, "display_pm": True, "12hour": True}, "world_clock": {"city_color": "White", "display_seconds": True, "display_pm": True, "12hour": True}}
with open('clock_screensaver.json', 'w') as f:
json.dump(clock_screensaver, f)
try:
f = open('csv/scheduler.json','r')
scheduler_settings = json.load(f)
@ -459,7 +467,8 @@ def index():
'place_settings':place_settings,
'market_settings':market_settings,
'sector_settings':sector_settings,
'networks_list': networks_list
'networks_list': networks_list,
'clock_screensaver': clock_screensaver
}