weather_icons code styling
This commit is contained in:
parent
e80387f66a
commit
ca16a16a56
@ -18,9 +18,7 @@ def get_weather_icon(icon_name, size) -> Image:
|
|||||||
iconpath = os.path.join(weatherdir, "owm_icons_cache", f"{icon_name}.png")
|
iconpath = os.path.join(weatherdir, "owm_icons_cache", f"{icon_name}.png")
|
||||||
|
|
||||||
if not os.path.exists(iconpath):
|
if not os.path.exists(iconpath):
|
||||||
urllib.request.urlretrieve(
|
urllib.request.urlretrieve(url=f"https://openweathermap.org/img/wn/{icon_name}@2x.png", filename=f"{iconpath}")
|
||||||
url=f"https://openweathermap.org/img/wn/{icon_name}@2x.png", filename=f"{iconpath}"
|
|
||||||
)
|
|
||||||
icon = Image.open(iconpath)
|
icon = Image.open(iconpath)
|
||||||
|
|
||||||
icon = icon.resize((size, size))
|
icon = icon.resize((size, size))
|
||||||
|
Loading…
Reference in New Issue
Block a user