mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 08:49:27 +00:00
Extract SIG and SIG_INFO from cluster spots. Closes #47
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user