bug fixes

This commit is contained in:
Neythen
2021-07-06 20:15:05 +01:00
parent cc48129f69
commit dbc750ed67
24 changed files with 98 additions and 107 deletions

View File

@@ -350,8 +350,10 @@ def updateWeather():
daily_weathers.append(daily_weather)
json.dump( current_weather, open( "csv/current_weather.json", 'w+' ))
json.dump( daily_weather, open( "csv/daily_weather.json", 'w+' ))
json.dump( current_weathers, open( "csv/current_weather.json", 'w+' ))
json.dump( daily_weathers, open( "csv/daily_weather.json", 'w+' ))
except Exception as e:
exc_type, exc_obj, exc_tb = sys.exc_info()
@@ -464,9 +466,6 @@ def updateLeagueEvents(api_key, league_id, time):
r = requests.get(url)
all_data = r.json()
print()
print(all_data['events'])
#print([all_data['events'][i]['strTimestamp'] for i in range(len(all_data['events']))])
events = []
@@ -610,9 +609,13 @@ if __name__ == '__main__':
#json.dump(update_times, f)
#f.close()
f = open('csv/last_updates.json', 'r')
last_updates = json.load(f)
f.close()
try:
f = open('csv/last_updates.json', 'r')
last_updates = json.load(f)
f.close()
except:
last_updates = {"stocks": "27/06/2021 07:05:39", "crypto": "27/06/2021 07:05:39", "news": "27/06/2021 07:05:39", "weather": "27/06/2021 07:05:39", "forex": "27/06/2021 07:05:39", "sports": "27/06/2021 07:05:39"}
t = time.time()
@@ -689,9 +692,9 @@ if __name__ == '__main__':
last_updates['forex'] = forex_time
updateForex()
f = open('csv/last_updates.json', 'w+')
json.dump(last_updates, f)
f.close()
json.dump(last_updates, open('csv/last_updates.json', 'w+'))
except Exception as e:
exc_type, exc_obj, exc_tb = sys.exc_info()