From b47ffa1366defb9dd8b8b3c691c02d77921ec83c Mon Sep 17 00:00:00 2001 From: Christian Jacobs Date: Tue, 27 Mar 2018 21:38:48 +0100 Subject: [PATCH] Try the country field if the grid square field fails to provide the correct information. --- pyqso/world_map.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyqso/world_map.py b/pyqso/world_map.py index a093156..f04a09a 100644 --- a/pyqso/world_map.py +++ b/pyqso/world_map.py @@ -218,14 +218,17 @@ class WorldMap: latitude, longitude = m.gs2ll(gridsquare) logging.debug("QTH coordinates found: (%s, %s)", str(latitude), str(longitude)) self.add_point(callsign, latitude, longitude) + return except ValueError: logging.exception("Unable to lookup QTH coordinates.") - elif(country): + + if(country): try: g = geocoder.google(country) latitude, longitude = g.latlng logging.debug("QTH coordinates found: (%s, %s)", str(latitude), str(longitude)) self.add_point(callsign, latitude, longitude) + return except ValueError: logging.exception("Unable to lookup QTH coordinates.") except Exception: