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
+5 -3
View File
@@ -1,3 +1,5 @@
from __future__ import annotations
from enum import Enum
@@ -44,7 +46,7 @@ class Mode(str, Enum):
return not (self.is_cw or self.is_phone)
@staticmethod
def from_name(name):
def from_name(name: str) -> Mode | None:
"""Convert a string to an enum mode using the alias table."""
if not name:
@@ -140,7 +142,7 @@ class ActivityName(str, Enum):
PGA = "PGA"
TOILETS = "Toilets"
def __str__(self):
def __str__(self) -> str:
return str(self.value)
@@ -179,7 +181,7 @@ class ActivityType(str, Enum):
# we already know, or we want to normalise things for consistency. The lookup table for this is here. Incoming spots
# that match a key in this table will be converted to the corresponding value, so only the modes above will actually be
# present in the spots.
MODE_ALIASES = {
MODE_ALIASES: dict[str, str] = {
"USB": "SSB",
"LSB": "SSB",
"DIGITALVOICE": "DV",