Try the country field if the grid square field fails to provide the correct information.

pull/70/head
Christian Jacobs 2018-03-27 21:38:48 +01:00
rodzic d945d40064
commit b47ffa1366
1 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -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: