mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-08-06 18:41:41 +00:00
Refactor of caching & data storage part 11 #118
This commit is contained in:
@@ -2,6 +2,7 @@ import logging
|
||||
|
||||
from pyhamtools import LookupLib, Callinfo
|
||||
|
||||
from core.utils import get_callsign_object_from_pyhamtools_callinfo
|
||||
from data.callsign import Callsign
|
||||
from providers.callsigndata.file_download_callsign_data_provider import FileDownloadCallsignDataProvider
|
||||
|
||||
@@ -28,21 +29,4 @@ class CountryFiles(FileDownloadCallsignDataProvider):
|
||||
return False
|
||||
|
||||
def lookup(self, callsign, lookup_credentials):
|
||||
# Lookup credentials are not required for this source.
|
||||
# Lat/lon will only be centre of country or capital city from this source
|
||||
ll = self._callinfo.get_lat_long(callsign)
|
||||
lat = None
|
||||
lon = None
|
||||
if ll and "latitude" in ll and "longitude" in ll:
|
||||
lat = float(ll["latitude"])
|
||||
lon = float(ll["longitude"])
|
||||
|
||||
return Callsign(call=callsign,
|
||||
home_call=self._callinfo.get_homecall(callsign),
|
||||
country=self._callinfo.get_country_name(callsign),
|
||||
dxcc_id=self._callinfo.get_adif_id(callsign),
|
||||
continent=self._callinfo.get_continent(callsign),
|
||||
cq_zone=self._callinfo.get_cqz(callsign),
|
||||
itu_zone=self._callinfo.get_ituz(callsign),
|
||||
latitude=lat,
|
||||
longitude=lon)
|
||||
return get_callsign_object_from_pyhamtools_callinfo(callsign, self._callinfo)
|
||||
|
||||
Reference in New Issue
Block a user