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,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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user