Refactor of caching & data storage part 16 #118

This commit is contained in:
Ian Renton
2026-08-03 22:15:29 +01:00
parent 27d73c27d6
commit 459d999f57
14 changed files with 93 additions and 55 deletions
+16 -4
View File
@@ -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