diff --git a/database_caller.py b/database_caller.py index db0cac5..4fb3a48 100755 --- a/database_caller.py +++ b/database_caller.py @@ -371,7 +371,11 @@ def updateLeagueTables(api_key): leagues_info = {} for league in leagues: - url += league + ',' + if league == 'Premier League': + url += 'PL,' + else: + url += league + ',' + url = url[:-1] # remove last comma url += '&apiKey=' + api_key r = requests.get(url) @@ -437,7 +441,11 @@ def updateLeagueEvents(api_key, time): leagues_info = {} for league in leagues: - url += league + ',' + + if league == 'Premier League': + url += 'PL,' + else: + url += league + ',' url = url[:-1] # remove last comma url += '&apiKey=' + api_key @@ -579,6 +587,8 @@ if __name__ == '__main__': api_keys = f.readlines() api_key = api_keys[0].strip() + + try: weather_key = api_keys[1].strip() diff --git a/server.py b/server.py index 9cbd2ef..d6e8299 100755 --- a/server.py +++ b/server.py @@ -237,7 +237,7 @@ def update(): os.system("sudo reboot now") return index() -@app.route("/restart", methods=['PUT','POST']) +@app.route("/restart") def restart(): os.system("sudo reboot now") return index() @@ -468,12 +468,14 @@ def screensaver(): global ticker global api_caller global screensaver_p - api_caller.close() - ticker.close() + data = str(request.data) if displaying_screensaver: screensaver_p.close() + else: + api_caller.close() + ticker.close() if "Pulsating Colors" in data: