Start converting some enum-like strings to proper enums, plus global reformat

This commit is contained in:
Ian Renton
2026-09-02 08:37:13 +01:00
parent 5a6fc19ab5
commit 606cf1be68
24 changed files with 81 additions and 79 deletions
+2 -4
View File
@@ -10,12 +10,10 @@ from requests_cache import CachedSession
from core.constants import HTTP_HEADERS
from core.data_store import CACHE_DIR, DATA_STORE
from core.enums import LocationSourceForCallsign, Continent
from core.enums import Continent, LocationSourceForCallsign
from core.url_data_cache import URLDataCache
from data.callsign import Callsign
from providers.callsigndata.api_query_callsign_data_provider import (
APIQueryCallsignDataProvider,
)
from providers.callsigndata.api_query_callsign_data_provider import APIQueryCallsignDataProvider
logger = logging.getLogger(__name__)
+1 -8
View File
@@ -20,14 +20,7 @@ class DTMBA(FileDownloadSIGRefDataProvider):
split = row.split(";")
ref_id = split[0]
ref_name = split[1]
new_data.append(
SIGRef(
sig=self.SIG,
id=ref_id,
name=ref_name,
ref_type="Building"
)
)
new_data.append(SIGRef(sig=self.SIG, id=ref_id, name=ref_name, ref_type="Building"))
# Bail out if a stop has been requested, i.e. the program is shutting down - no need to parse the rest of
# the data in this case
+3 -1
View File
@@ -76,7 +76,9 @@ class WOTA(HTTPSpotProvider):
except Exception:
logger.warning(f"Could not parse WOTA spot description: {source_spot.description}")
time = datetime.strptime(source_spot.pub_date.content, self.RSS_DATE_TIME_FORMAT).astimezone(pytz.UTC)
time = datetime.strptime(source_spot.pub_date.content, self.RSS_DATE_TIME_FORMAT).astimezone(
pytz.UTC
)
# Convert to our spot format
spot = Spot(