kopia lustrzana https://github.com/ctjacobs/pyqso
Try the country field if the grid square field fails to provide the correct information.
rodzic
d945d40064
commit
b47ffa1366
|
@ -218,14 +218,17 @@ class WorldMap:
|
||||||
latitude, longitude = m.gs2ll(gridsquare)
|
latitude, longitude = m.gs2ll(gridsquare)
|
||||||
logging.debug("QTH coordinates found: (%s, %s)", str(latitude), str(longitude))
|
logging.debug("QTH coordinates found: (%s, %s)", str(latitude), str(longitude))
|
||||||
self.add_point(callsign, latitude, longitude)
|
self.add_point(callsign, latitude, longitude)
|
||||||
|
return
|
||||||
except ValueError:
|
except ValueError:
|
||||||
logging.exception("Unable to lookup QTH coordinates.")
|
logging.exception("Unable to lookup QTH coordinates.")
|
||||||
elif(country):
|
|
||||||
|
if(country):
|
||||||
try:
|
try:
|
||||||
g = geocoder.google(country)
|
g = geocoder.google(country)
|
||||||
latitude, longitude = g.latlng
|
latitude, longitude = g.latlng
|
||||||
logging.debug("QTH coordinates found: (%s, %s)", str(latitude), str(longitude))
|
logging.debug("QTH coordinates found: (%s, %s)", str(latitude), str(longitude))
|
||||||
self.add_point(callsign, latitude, longitude)
|
self.add_point(callsign, latitude, longitude)
|
||||||
|
return
|
||||||
except ValueError:
|
except ValueError:
|
||||||
logging.exception("Unable to lookup QTH coordinates.")
|
logging.exception("Unable to lookup QTH coordinates.")
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|
Ładowanie…
Reference in New Issue