polybar-weather: use country if city is unavailable

This commit is contained in:
Vincent Bernat 2021-10-22 07:21:11 +02:00
parent 385360b516
commit ac6410af1a

View file

@ -29,7 +29,9 @@ def get_location():
)
return (
(data["location"]["latitude"], data["location"]["longitude"]),
data["city"]["names"]["en"],
data["city"]["names"]["en"]
if "city" in data
else data["country"]["names"]["en"],
)