From 7bd39c58d556b9fc370f7034608ba9f461aebf0e Mon Sep 17 00:00:00 2001 From: Justin Date: Wed, 13 Sep 2023 22:49:54 +0800 Subject: [PATCH] replace corporation wtih corp --- database_caller.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/database_caller.py b/database_caller.py index e8b2e7b..8d4fbee 100755 --- a/database_caller.py +++ b/database_caller.py @@ -190,7 +190,7 @@ def updateStocks(api_key, logf): if 'name' in stock_info[data[symbol]['quote']['symbol']] and stock_info[data[symbol]['quote']['symbol']]['name'] != '': stock_info[data[symbol]['quote']['symbol']] = {'current': str(data[symbol]['quote']['latestPrice']), 'change': str(data[symbol]['quote']['change']), 'percent_change': str(data[symbol]['quote']['changePercent'] * 100), 'day_low': str(data[symbol]['quote']['low']), 'day_high': str(data[symbol]['quote']['high']), 'volume': str(human_format(data[symbol]['quote']['latestVolume'])), 'name': stock_info[data[symbol]['quote']['symbol']]['name']} else: - stock_info[data[symbol]['quote']['symbol']] = {'current': str(data[symbol]['quote']['latestPrice']), 'change': str(data[symbol]['quote']['change']), 'percent_change': str(data[symbol]['quote']['changePercent'] * 100), 'day_low': str(data[symbol]['quote']['low']), 'day_high': str(data[symbol]['quote']['high']), 'volume': str(human_format(data[symbol]['quote']['latestVolume'])), 'name': data[symbol]['quote']['companyName'].split(' - ')[0].replace('Corp.', 'Corp')} + stock_info[data[symbol]['quote']['symbol']] = {'current': str(data[symbol]['quote']['latestPrice']), 'change': str(data[symbol]['quote']['change']), 'percent_change': str(data[symbol]['quote']['changePercent'] * 100), 'day_low': str(data[symbol]['quote']['low']), 'day_high': str(data[symbol]['quote']['high']), 'volume': str(human_format(data[symbol]['quote']['latestVolume'])), 'name': data[symbol]['quote']['companyName'].split(' - ')[0].replace('Corp.', 'Corp').replace('Corporation', 'Corp')} except: pass all_stocks_settings['symbols'] = stock_info @@ -896,7 +896,7 @@ def updateMarket(api_key, logf): "day_low": str(item['low']), "day_high": str(item['high']), "volume": human_format(item['latestVolume']), - "name": item['companyName'].split(' - ')[0].replace('Corp.', 'Corp') + "name": item['companyName'].split(' - ')[0].replace('Corp.', 'Corp').replace('Corporation', 'Corp') } except: pass @@ -909,7 +909,7 @@ def updateMarket(api_key, logf): "day_low": str(item['low']), "day_high": str(item['high']), "volume": human_format(item['latestVolume']), - "name": item['companyName'].split(' - ')[0].replace('Corp.', 'Corp') + "name": item['companyName'].split(' - ')[0].replace('Corp.', 'Corp').replace('Corporation', 'Corp') } except: pass @@ -922,7 +922,7 @@ def updateMarket(api_key, logf): "day_low": str(item['low']), "day_high": str(item['high']), "volume": human_format(item['latestVolume']), - "name": item['companyName'].split(' - ')[0].replace('Corp.', 'Corp') + "name": item['companyName'].split(' - ')[0].replace('Corp.', 'Corp').replace('Corporation', 'Corp') } except: pass