|
|
|
@ -8,7 +8,8 @@ windWords = ["wind", "windy", "gusts"] |
|
|
|
def parseDescription(desc): |
|
|
|
# Parse a weather description by returning the first |
|
|
|
# "weather word" in a NWS description. |
|
|
|
parsed = desc.split(" ") |
|
|
|
# parsed = ((desc.lower()).split("/")).split(" ") |
|
|
|
parsed = ((desc.lower()).split(" ")) |
|
|
|
|
|
|
|
for i in parsed: |
|
|
|
if i in adjectives: |
|
|
|
@ -30,14 +31,20 @@ def parseDescription(desc): |
|
|
|
def imageSelector(desc, timeOfDay): |
|
|
|
match desc: |
|
|
|
case "Clear": |
|
|
|
return "./smallIcons/clear-day-small.png" |
|
|
|
if timeOfDay == "day": |
|
|
|
return "/smallIcons/clear-day-small.png" |
|
|
|
else: |
|
|
|
return "/smallIcons/clear-night-small.png" |
|
|
|
case "Cloudy": |
|
|
|
return "./smallIcons/cloudy-small.png" |
|
|
|
if timeOfDay == "day": |
|
|
|
return "/smallIcons/overcast-day-small.png" |
|
|
|
else: |
|
|
|
return "/smallIcons/overcast-night-small.png" |
|
|
|
case "Wind": |
|
|
|
return "./smallIcons/wind-small.png" |
|
|
|
return "/smallIcons/wind-small.png" |
|
|
|
case "Thunderstorm": |
|
|
|
return "./smallIcons/thunderstorms-day-small.png" |
|
|
|
return "/smallIcons/thunderstorms-rain-small.png" |
|
|
|
case "Rain": |
|
|
|
return "./smallIcons/rain-small.png" |
|
|
|
return "/smallIcons/rain-small.png" |
|
|
|
|
|
|
|
return "" |
|
|
|
return "/smallIcons/code-red-small.png" |
|
|
|
|