mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-08-06 10:31:42 +00:00
Refactor of caching & data storage part 16 #118
This commit is contained in:
@@ -4,6 +4,7 @@ from pyhamtools import LookupLib, Callinfo
|
||||
|
||||
from core.data_store import DATA_STORE
|
||||
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
|
||||
|
||||
|
||||
@@ -30,7 +31,18 @@ class CountryFiles(FileDownloadCallsignDataProvider):
|
||||
return False
|
||||
|
||||
def _perform_new_lookup(self, callsign, lookup_credentials):
|
||||
if self._callinfo:
|
||||
return get_callsign_object_from_pyhamtools_callinfo(callsign, self._callinfo)
|
||||
else:
|
||||
return None
|
||||
callsign_data = Callsign(call=callsign)
|
||||
|
||||
try:
|
||||
if self._callinfo:
|
||||
callsign_data = get_callsign_object_from_pyhamtools_callinfo(callsign, self._callinfo)
|
||||
self.status = "OK"
|
||||
self.lookup_count += 1
|
||||
else:
|
||||
return None
|
||||
|
||||
except Exception as e:
|
||||
self.status = "Error"
|
||||
logging.error("Exception when looking up data from Country file", e, exc_info=True)
|
||||
|
||||
return callsign_data
|
||||
|
||||
Reference in New Issue
Block a user