Trying to avoid error propagation from Google Weather overuse
This commit is contained in:
@@ -21,10 +21,13 @@ d.multiline_text((1, 1), txt1, font=fntBold, fill=0)
|
||||
#txt2 = "This is the day that the LORD has made\nWe will rejoice and be glad in it."
|
||||
#txt2 = asyncio.run(getweather())
|
||||
d.multiline_text((1, 35), "Weather:", font=fnt, fill=0)
|
||||
weather = google_weather.get_google_weather()
|
||||
txt2 = " Current: "+weather["current"] \
|
||||
try:
|
||||
weather = google_weather.get_google_weather()
|
||||
txt2 = " Current: "+weather["current"] \
|
||||
+"\n Today's forecast: "+weather["forecast_today"] \
|
||||
+"\n Tomorrow: "+weather["forecast_tomorrow"]
|
||||
except: # Assume the weather API blew up
|
||||
txt2 = "Problem getting weather"
|
||||
d.multiline_text((1, 60), txt2, font=fnt, fill=0)
|
||||
d.multiline_text((1, 135), "Pirates:", font=fnt, fill=0)
|
||||
d.multiline_text((3,160), mlb.get_pirates(), font=fnt, fill=0)
|
||||
|
||||
Reference in New Issue
Block a user