crypto, forex and weather api caller refactored

This commit is contained in:
Neythen
2021-09-25 10:40:29 +01:00
parent 24e4e890ef
commit 24a1bc882f
14 changed files with 250 additions and 241 deletions

View File

@@ -74,7 +74,7 @@ def index():
upcoming_games = json.load(open('csv/upcoming_games.json', 'r'))
live_games = json.load(open('csv/live_games.json', 'r'))
past_games = json.load(open('csv/past_games.json', 'r'))
team_stats = json.load(open('csv/team_stats.json', 'r'))
team_stats = json.load(open('csv/league_tables.json', 'r'))
image_settings = json.load(open('csv/image_settings.json', 'r'))
GIF_settings = json.load(open('csv/GIF_settings.json', 'r'))
@@ -424,7 +424,7 @@ def save_weather_settings(input_settings):
current_settings['current_weather'] = input_settings['current_weather']
current_settings = combine_dict(current_settings, input_settings['cities'], 'cities')
current_settings = combine_dict(current_settings, input_settings['locations'], 'locations')
json.dump(current_settings, open('csv/' + filename, 'w+'))
@@ -455,14 +455,14 @@ def save_sports_settings(input_settings):
elif feature == 'Sports (Live Games)':
filename = 'live_games.json'
elif feature == 'Sports (Team Stats)':
filename = 'team_stats.json'
filename = 'league_tables.json'
current_settings = json.load(open('csv/' + filename, 'r'))
current_settings['speed'] = input_settings['speed'].lower()
current_settings['animation'] = input_settings['animation'].lower()
current_settings['title'] = input_settings['title']
current_settings['feature'] = input_settings['feature']
current_settings = combine_dict(current_settings, input_settings['leagues'], 'leagues')