From 8c7118ee351572e3fce27f32bec6a8a5d54caa06 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Fri, 22 Oct 2021 07:23:39 +0200 Subject: [PATCH] polybar-weather: more compact --- bin/polybar-weather | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/polybar-weather b/bin/polybar-weather index fd36777..7ce4c66 100755 --- a/bin/polybar-weather +++ b/bin/polybar-weather @@ -29,9 +29,7 @@ def get_location(): ) return ( (data["location"]["latitude"], data["location"]["longitude"]), - data["city"]["names"]["en"] - if "city" in data - else data["country"]["names"]["en"], + (data.get("city") or data["country"])["names"]["en"], )