Fix some IDE warnings, mostly around type safety on the Python side

This commit is contained in:
Ian Renton
2026-06-19 21:33:46 +01:00
parent 05ac652cee
commit edb2641f76
42 changed files with 319 additions and 187 deletions

View File

@@ -15,51 +15,51 @@ class Alert:
"""Data class that defines an alert."""
# Unique identifier for the alert
id: str = None
id: str | None = None
# Callsigns of the operators that has been alerted
dx_calls: list = None
dx_calls: list | None = None
# Names of the operators that has been alerted
dx_names: list = None
dx_names: list | None = None
# Country of the DX operator
dx_country: str = None
dx_country: str | None = None
# Country flag of the DX operator
dx_flag: str = None
dx_flag: str | None = None
# Continent of the DX operator
dx_continent: str = None
dx_continent: str | None = None
# DXCC ID of the DX operator
dx_dxcc_id: int = None
dx_dxcc_id: int | None = None
# CQ zone of the DX operator
dx_cq_zone: int = None
dx_cq_zone: int | None = None
# ITU zone of the DX operator
dx_itu_zone: int = None
dx_itu_zone: int | None = None
# Intended frequencies & modes of operation. Essentially just a different kind of comment field.
freqs_modes: str = None
freqs_modes: str | None = None
# Start time of the activation, UTC seconds since UNIX epoch
start_time: float = None
start_time: float | None = None
# Start time of the activation of the alert, ISO 8601
start_time_iso: str = None
start_time_iso: str | None = None
# End time of the activation, UTC seconds since UNIX epoch. Optional
end_time: float = None
end_time: float | None = None
# End time of the activation of the alert, ISO 8601
end_time_iso: str = None
end_time_iso: str | None = None
# Time that this software received the alert, UTC seconds since UNIX epoch. This is used with the "since_received"
# call to our API to receive all data that is new to us, even if by a quirk of the API it might be older than the
# list time the client polled the API.
received_time: float = None
received_time: float | None = None
# Time that this software received the alert, ISO 8601
received_time_iso: str = None
received_time_iso: str | None = None
# Comment made by the alerter, if any
comment: str = None
comment: str | None = None
# Special Interest Group (SIG), e.g. outdoor activity programme such as POTA
sig: str = None
sig: str | None = None
# SIG references. We allow multiple here for e.g. n-fer activations, unlike ADIF SIG_INFO
sig_refs: list = None
sig_refs: list | None = None
# Whether this alert is for a DXpedition, as opposed to e.g. an xOTA programme.
is_dxpedition: bool = False
# Where we got the alert from, e.g. "POTA", "SOTA"...
source: str = None
source: str | None = None
# The ID the source gave it, if any.
source_id: str = None
source_id: str | None = None
def infer_missing(self, credentials=None):
"""Infer missing parameters where possible"""