mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 14:27:42 +00:00
Start converting some enum-like strings to proper enums, plus global reformat
This commit is contained in:
+4
-4
@@ -15,7 +15,7 @@ from core.constants import (
|
||||
UNKNOWN_BAND,
|
||||
)
|
||||
from core.data_store import DATA_STORE
|
||||
from core.enums import Continent
|
||||
from core.enums import Continent, ModeType
|
||||
from data.callsign import Callsign, LocationSourceForCallsign
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -44,11 +44,11 @@ def infer_mode_type_from_mode(mode):
|
||||
"""Infer a "mode family" from a mode."""
|
||||
|
||||
if mode.upper() in CW_MODES:
|
||||
return "CW"
|
||||
return ModeType.CW
|
||||
elif mode.upper() in PHONE_MODES:
|
||||
return "PHONE"
|
||||
return ModeType.PHONE
|
||||
elif mode.upper() in DATA_MODES:
|
||||
return "DATA"
|
||||
return ModeType.DATA
|
||||
else:
|
||||
if mode.upper() != "OTHER" and mode != "?":
|
||||
logger.warning(f"Found an unrecognised mode: {mode}. Developer should categorise this.")
|
||||
|
||||
Reference in New Issue
Block a user