Autogenerated type safety parameterisation of all methods

This commit is contained in:
Ian Renton
2026-09-20 20:02:19 +01:00
parent 6037e742cc
commit 324dd1414b
132 changed files with 1228 additions and 706 deletions
+8 -3
View File
@@ -1,4 +1,9 @@
from __future__ import annotations
import logging
from typing import Any
from requests import Response
from core.data_store import DATA_STORE
from providers.staticdata.file_download_static_data_provider import (
@@ -15,14 +20,14 @@ class K0SWE(FileDownloadStaticDataProvider):
POLL_INTERVAL_DAYS = 7
DATA_URL = "https://raw.githubusercontent.com/k0swe/dxcc-json/refs/heads/main/dxcc.json"
def __init__(self, provider_config):
def __init__(self, provider_config: dict[str, Any]) -> None:
super().__init__("K0SWE DXCC JSON", provider_config, self.DATA_URL, self.POLL_INTERVAL_DAYS)
def _handle_http_response(self, http_response):
def _handle_http_response(self, http_response: Response) -> bool:
try:
dxcc_list = http_response.json()["dxcc"]
# Reformat as a map for to place in the data store
dxcc_map = {}
dxcc_map: dict[int, Any] = {}
for dxcc in dxcc_list:
dxcc_map[dxcc["entityCode"]] = dxcc