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:
+3
-3
@@ -1,6 +1,6 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
from core.enums import LocationSourceForCallsign
|
||||
from core.enums import Continent, LocationSourceForCallsign
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -30,14 +30,14 @@ class Callsign:
|
||||
# Country in which the callsign indicates they are operating
|
||||
country: str | None = None
|
||||
# Continent in which the callsign indicates they are operating
|
||||
continent: str | None = None
|
||||
continent: Continent | None = None
|
||||
# DXCC ID in which the callsign indicates they are operating
|
||||
dxcc_id: int | None = None
|
||||
# CQ zone in which the callsign indicates they are operating
|
||||
cq_zone: int | None = None
|
||||
# ITU zone in which the callsign indicates they are operating
|
||||
itu_zone: int | None = None
|
||||
# Location source. This can be "HOME QTH" or "DXCC" depending on which provider gave us a location
|
||||
# Location source
|
||||
location_source: LocationSourceForCallsign = LocationSourceForCallsign.NONE
|
||||
|
||||
def fully_populated(self):
|
||||
|
||||
+4
-4
@@ -12,7 +12,7 @@ from pyhamtools.locator import latlong_to_locator, locator_to_latlong
|
||||
from core.call_lookup_helper import get_call_info
|
||||
from core.config import MAX_SPOT_AGE
|
||||
from core.constants import MODE_ALIASES, PROPAGATION_MODES, SIGS
|
||||
from core.enums import Continent, LocationSourceForSpot, ModeSource
|
||||
from core.enums import Continent, LocationSourceForSpot, ModeSource, ModeType
|
||||
from core.geo_utils import lat_lon_to_cq_zone, lat_lon_to_itu_zone
|
||||
from core.sig_lookup_helper import populate_missing_sig_ref_info
|
||||
from core.sig_utils import (
|
||||
@@ -104,9 +104,9 @@ class Spot:
|
||||
|
||||
# Reported mode, such as SSB, PHONE, CW, FT8...
|
||||
mode: str | None = None
|
||||
# Inferred mode "family". One of "CW", "PHONE" or "DIGI".
|
||||
mode_type: str | None = None
|
||||
# Source of the mode information. "SPOT", "COMMENT", "BANDPLAN" or "NONE"
|
||||
# Inferred mode "family".
|
||||
mode_type: ModeType = ModeType.UNKNOWN
|
||||
# Source of the mode information.
|
||||
mode_source: ModeSource = ModeSource.NONE
|
||||
# Frequency, in Hz
|
||||
freq: float | None = None
|
||||
|
||||
Reference in New Issue
Block a user