This commit is contained in:
Justin 2023-09-26 16:30:14 +08:00 committed by GitHub
parent fb535bc82e
commit 58805d63c6
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) globalstocks_settings = json.load(f)
f.close() f.close()
except: 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": {"0001.HK": {"current": "40.65", "change": "-0.6499977", "percent_change": "-1.5738443", "day_low": "40.65", "day_high": "41.4", "volume": "3.37M", "name": "CK Hutchison Holdings Ltd"}, "NESN.SW": {"current": "106.82", "change": "-0.3199997", "percent_change": "-0.29867435", "day_low": "106.2", "day_high": "106.92", "volume": "187K", "name": "Nestl\u00e9 S.A."}, "MBG.DE": {"current": "65.6", "change": "-0.7799988", "percent_change": "-1.1750509", "day_low": "65.26", "day_high": "66.36", "volume": "278K", "name": "Mercedes-Benz Group AG"}, "MC.PA": {"current": "701.4", "change": "-11.899963", "percent_change": "-1.6682972", "day_low": "696.8", "day_high": "705.4", "volume": "106K", "name": "LVMH Mo\u00ebt Hennessy - Louis Vuitton Soci\u00e9t\u00e9 Europ\u00e9enne"}, "9984.T": {"current": "6370.0", "change": "-54.0", "percent_change": "-0.8405978", "day_low": "6358.0", "day_high": "6470.0", "volume": "7.87M", "name": "SoftBank Group Corp."}, "0700.HK": {"current": "300.0", "change": "-4.399994", "percent_change": "-1.4454645", "day_low": "298.2", "day_high": "303.6", "volume": "14.5M", "name": "Tencent Holdings Ltd"}}}
with open('csv/globalstocks_settings.json', 'w') as f: with open('csv/globalstocks_settings.json', 'w') as f:
json.dump(globalstocks_settings, f) json.dump(globalstocks_settings, f)
try: try:
@ -1876,8 +1876,8 @@ def save_globalstocks_settings(input_settings):
current_settings = json.load(f) current_settings = json.load(f)
f.close() f.close()
except: 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": {"0001.HK": {"current": "40.65", "change": "-0.6499977", "percent_change": "-1.5738443", "day_low": "40.65", "day_high": "41.4", "volume": "3.37M", "name": "CK Hutchison Holdings Ltd"}, "NESN.SW": {"current": "106.82", "change": "-0.3199997", "percent_change": "-0.29867435", "day_low": "106.2", "day_high": "106.92", "volume": "187K", "name": "Nestl\u00e9 S.A."}, "MBG.DE": {"current": "65.6", "change": "-0.7799988", "percent_change": "-1.1750509", "day_low": "65.26", "day_high": "66.36", "volume": "278K", "name": "Mercedes-Benz Group AG"}, "MC.PA": {"current": "701.4", "change": "-11.899963", "percent_change": "-1.6682972", "day_low": "696.8", "day_high": "705.4", "volume": "106K", "name": "LVMH Mo\u00ebt Hennessy - Louis Vuitton Soci\u00e9t\u00e9 Europ\u00e9enne"}, "9984.T": {"current": "6370.0", "change": "-54.0", "percent_change": "-0.8405978", "day_low": "6358.0", "day_high": "6470.0", "volume": "7.87M", "name": "SoftBank Group Corp."}, "0700.HK": {"current": "300.0", "change": "-4.399994", "percent_change": "-1.4454645", "day_low": "298.2", "day_high": "303.6", "volume": "14.5M", "name": "Tencent Holdings Ltd"}}}
current_settings['speed'] = input_settings['speed'].lower() current_settings['speed'] = input_settings['speed'].lower()
current_settings['speed2'] = input_settings['speed2'].lower() current_settings['speed2'] = input_settings['speed2'].lower()
current_settings['animation'] = input_settings['animation'].lower() current_settings['animation'] = input_settings['animation'].lower()