Extract SIG and SIG_INFO from cluster spots. Closes #47

This commit is contained in:
Ian Renton
2025-10-20 11:05:45 +01:00
parent a21782cb62
commit 20977e59cf
16 changed files with 44 additions and 6 deletions

View File

@@ -7,6 +7,7 @@ import pytz
from requests_cache import CachedSession
from core.constants import HTTP_HEADERS
from core.utils import get_icon_for_sig
from data.spot import Spot
from spotproviders.http_spot_provider import HTTPSpotProvider
@@ -41,6 +42,7 @@ class ParksNPeaks(HTTPSpotProvider):
comment=source_spot["actComments"],
sig=source_spot["actClass"],
sig_refs=[source_spot["actSiteID"]],
icon=get_icon_for_sig(source_spot["actClass"]),
time=datetime.strptime(source_spot["actTime"], "%Y-%m-%d %H:%M:%S").replace(
tzinfo=pytz.UTC).timestamp())
@@ -50,7 +52,7 @@ class ParksNPeaks(HTTPSpotProvider):
# Extract a de_call if it's in the comment but not in the "actSpoter" field
m = re.search(r"\(de ([A-Za-z0-9]*)\)", spot.comment)
if (not spot.de_call or spot.de_call == "ZLOTA") and m is not None:
if (not spot.de_call or spot.de_call == "ZLOTA") and m:
spot.de_call = m.group(1)
# Log a warning for the developer if PnP gives us an unknown programme we've never seen before