replace corporation wtih corp

This commit is contained in:
Justin 2023-09-13 22:49:54 +08:00 committed by GitHub
parent 2025caad73
commit 7bd39c58d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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