changed to dict for global stocks symbols

This commit is contained in:
Justin 2023-09-26 15:06:22 +08:00 committed by GitHub
parent c32e1ab105
commit 3083bf9458
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -263,7 +263,7 @@ def index():
globalstocks_settings = json.load(f)
f.close()
except:
globalstocks_settings = {"feature": "Global Stocks", "speed": "medium", "speed2": "medium", "animation": "continuous", "percent": True, "point": True, "logos": True, "chart": False, "title": True, "lohivol": True, "display_name": False, "symbols": []}
globalstocks_settings = {"feature": "Global Stocks", "speed": "medium", "speed2": "medium", "animation": "continuous", "percent": True, "point": True, "logos": True, "chart": False, "title": True, "lohivol": True, "display_name": False, "symbols": {}}
with open('csv/globalstocks_settings.json', 'w') as f:
json.dump(globalstocks_settings, f)
try:
@ -1850,7 +1850,7 @@ def save_globalstocks_settings(input_settings):
current_settings = json.load(f)
f.close()
except:
current_settings = {"feature": "Global Stocks", "speed": "medium", "speed2": "medium", "animation": "continuous", "percent": True, "point": True, "logos": True, "chart": False, "title": True, "lohivol": True, "display_name": False, "symbols": []}
current_settings = {"feature": "Global Stocks", "speed": "medium", "speed2": "medium", "animation": "continuous", "percent": True, "point": True, "logos": True, "chart": False, "title": True, "lohivol": True, "display_name": False, "symbols": {}}
current_settings['speed'] = input_settings['speed'].lower()
current_settings['speed2'] = input_settings['speed2'].lower()