From 2b6db3a0c604e6ac3bb168dd5a5add8dab2350c3 Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Sun, 31 Oct 2021 21:56:50 +0100 Subject: [PATCH] Fix minor errors --- lib/location.py | 2 ++ lib/wttr_srv.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/lib/location.py b/lib/location.py index 4192862..7b36e79 100644 --- a/lib/location.py +++ b/lib/location.py @@ -334,6 +334,8 @@ def _get_hemisphere(location): """ if all(location): location_string = ", ".join(location) + else: + return True geolocation = _geolocator(location_string) if geolocation is None: diff --git a/lib/wttr_srv.py b/lib/wttr_srv.py index 4ebc397..e7fe484 100644 --- a/lib/wttr_srv.py +++ b/lib/wttr_srv.py @@ -210,6 +210,9 @@ def _response(parsed_query, query, fast_mode=False): # so we handle it with all available logic loc = (parsed_query['orig_location'] or "").lower() if parsed_query.get("view"): + if not parsed_query.get("location"): + parsed_query["location"] = loc + output = wttr_line(query, parsed_query) elif loc == 'moon' or loc.startswith('moon@'): output = get_moon(parsed_query)