mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-21 06:47:42 +00:00
Autogenerated type safety parameterisation of all methods
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from typing import Any
|
||||
|
||||
from pyhamtools import Callinfo, LookupLib
|
||||
|
||||
from core.data_store import DATA_STORE
|
||||
from core.utils import get_callsign_object_from_pyhamtools_callinfo
|
||||
from data.callsign import Callsign
|
||||
from data.lookup_credentials import LookupCredentials
|
||||
from providers.callsigndata.file_download_callsign_data_provider import (
|
||||
FileDownloadCallsignDataProvider,
|
||||
)
|
||||
@@ -18,9 +22,9 @@ class CountryFiles(FileDownloadCallsignDataProvider):
|
||||
POLL_INTERVAL_DAYS = 30
|
||||
DATA_URL = "https://www.country-files.com/cty/cty.plist"
|
||||
CACHE_PATH = "cache/cty.plist"
|
||||
_callinfo = None
|
||||
_callinfo: Callinfo | None = None
|
||||
|
||||
def __init__(self, provider_config):
|
||||
def __init__(self, provider_config: dict[str, Any]) -> None:
|
||||
super().__init__(
|
||||
"CountryFiles.com",
|
||||
provider_config,
|
||||
@@ -30,7 +34,7 @@ class CountryFiles(FileDownloadCallsignDataProvider):
|
||||
DATA_STORE.callsign_data_countryfiles,
|
||||
)
|
||||
|
||||
def _handle_file(self, path):
|
||||
def _handle_file(self, path: str) -> bool:
|
||||
try:
|
||||
lookuplib = LookupLib(lookuptype="countryfile", filename=path)
|
||||
self._callinfo = Callinfo(lookuplib)
|
||||
@@ -40,7 +44,7 @@ class CountryFiles(FileDownloadCallsignDataProvider):
|
||||
logger.exception("Exception when loading Country Files cty.plist.")
|
||||
return False
|
||||
|
||||
def _perform_new_lookup(self, callsign, lookup_credentials):
|
||||
def _perform_new_lookup(self, callsign: str, lookup_credentials: LookupCredentials | None) -> Callsign | None:
|
||||
callsign_data = Callsign(call=callsign)
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user