added "display_name": False, to try except

This commit is contained in:
Justin 2023-09-13 21:48:21 +08:00 committed by GitHub
parent 3d12367f9a
commit d53e9b4da4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 6 deletions

View File

@ -164,7 +164,7 @@ def updateStocks(api_key, logf):
all_stocks_settings = json.load(f)
f.close()
except:
all_stocks_settings = {"feature": "Stocks", "speed": "medium", "speed2": "medium", "animation": "down", "percent": False, "point": True, "logos": True, "chart": False, "title": True, "symbols": {"AAPL": {"current": "164.02", "change": "-1.59", "percent_change": "-0.97"}, "MSFT": {"current": "288.29", "change": "-1.32", "percent_change": "-0.46"}, "GOOG": {"current": "2586.74", "change": "-34.01", "percent_change": "-1.31"}, "NFLX": {"current": "380.52", "change": "-7.59", "percent_change": "-1.99"}}, "prepost": False, "lohivol": False}
all_stocks_settings = {"feature": "Stocks", "speed": "medium", "speed2": "medium", "animation": "down", "percent": False, "point": True, "logos": True, "chart": False, "title": True, "symbols": {"AAPL": {"current": "164.02", "change": "-1.59", "percent_change": "-0.97"}, "MSFT": {"current": "288.29", "change": "-1.32", "percent_change": "-0.46"}, "GOOG": {"current": "2586.74", "change": "-34.01", "percent_change": "-1.31"}, "NFLX": {"current": "380.52", "change": "-7.59", "percent_change": "-1.99"}}, "prepost": False, "lohivol": False, "display_name": False}
stock_info = all_stocks_settings['symbols']
symbols = list(stock_info.keys())
@ -619,7 +619,7 @@ def updateCrypto(api_key, logf):
all_crypto_settings = json.load(f)
f.close()
except:
all_crypto_settings = {"feature": "Stocks", "speed": "medium","speed2": "medium", "animation": "down", "percent": False, "point": True, "logos": True, "chart": False, "title": True, "lohivol": False, "symbols": {"ETH,USD": {"current": "2629.32", "24hr_change": "-27.6432", "percent_change": "-1.04"}, "BTC,USD": {"current": "38161.00", "24hr_change": "-50.8386", "percent_change": "-0.13"}, "BNB,USD": {"current": "372.57", "24hr_change": "0.4140", "percent_change": "0.11"}, "ADA,BTC": {"current": "0.0000", "24hr_change": "-0.0000", "percent_change": "-3.74"}}}
all_crypto_settings = {"feature": "Stocks", "speed": "medium","speed2": "medium", "animation": "down", "percent": False, "point": True, "logos": True, "chart": False, "title": True, "lohivol": False, "display_name": False, "symbols": {"ETH,USD": {"current": "2629.32", "24hr_change": "-27.6432", "percent_change": "-1.04"}, "BTC,USD": {"current": "38161.00", "24hr_change": "-50.8386", "percent_change": "-0.13"}, "BNB,USD": {"current": "372.57", "24hr_change": "0.4140", "percent_change": "0.11"}, "ADA,BTC": {"current": "0.0000", "24hr_change": "-0.0000", "percent_change": "-3.74"}}}
coin_info = all_crypto_settings['symbols']
symbol_base = list(coin_info.keys())
@ -864,7 +864,7 @@ def updateMarket(api_key, logf):
all_market_settings = json.load(f)
f.close()
except:
all_market_settings = {"feature": "Gainers, Losers, Active", "speed": "medium", "speed2": "medium", "animation": "up", "percent": True, "point": True, "logos": True, "chart": False, "title": True, "lohivol": False, "categories": ["Top Gainers", "Top Losers", "Most Active"], "gainers": {}, "losers": {}, "mostactive": {}}
all_market_settings = {"feature": "Gainers, Losers, Active", "speed": "medium", "speed2": "medium", "animation": "up", "percent": True, "point": True, "logos": True, "chart": False, "title": True, "lohivol": False, "display_name": False, "categories": ["Top Gainers", "Top Losers", "Most Active"], "gainers": {}, "losers": {}, "mostactive": {}}
try:
f = open('csv/sector_settings.json', 'r')
@ -895,7 +895,8 @@ def updateMarket(api_key, logf):
"percent_change": str(item['changePercent'] * 100),
"day_low": str(item['low']),
"day_high": str(item['high']),
"volume": human_format(item['latestVolume'])
"volume": human_format(item['latestVolume']),
"name": item['companyName'].split(' - ')[0].replace('Corp.', 'Corp')
}
except:
pass
@ -907,7 +908,8 @@ def updateMarket(api_key, logf):
"percent_change": str(item['changePercent'] * 100),
"day_low": str(item['low']),
"day_high": str(item['high']),
"volume": human_format(item['latestVolume'])
"volume": human_format(item['latestVolume']),
"name": item['companyName'].split(' - ')[0].replace('Corp.', 'Corp')
}
except:
pass
@ -919,7 +921,8 @@ def updateMarket(api_key, logf):
"percent_change": str(item['changePercent'] * 100),
"day_low": str(item['low']),
"day_high": str(item['high']),
"volume": human_format(item['latestVolume'])
"volume": human_format(item['latestVolume']),
"name": item['companyName'].split(' - ')[0].replace('Corp.', 'Corp')
}
except:
pass