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,8 @@ from time import sleep
|
||||
import pytz
|
||||
import telnetlib3
|
||||
|
||||
from core.constants import SIGS
|
||||
from core.utils import ANY_SIG_REGEX, ANY_SIG_REF_REGEX, get_icon_for_sig
|
||||
from data.spot import Spot
|
||||
from core.config import SERVER_OWNER_CALLSIGN
|
||||
from spotproviders.spot_provider import SpotProvider
|
||||
@@ -75,7 +77,15 @@ class DXCluster(SpotProvider):
|
||||
icon="desktop",
|
||||
time=spot_datetime.timestamp())
|
||||
|
||||
# See if the comment looks like it contains a SIG (and optionally SIG reference)
|
||||
# See if the comment looks like it contains a SIG (and optionally SIG reference). Currently,
|
||||
# only one sig ref is supported.
|
||||
sig_match = re.search(r"(^|\W)" + ANY_SIG_REGEX + r"($|\W)", spot.comment, re.IGNORECASE)
|
||||
if sig_match:
|
||||
spot.sig = sig_match.group(2).upper()
|
||||
spot.icon = get_icon_for_sig(spot.sig)
|
||||
sig_ref_match = re.search(r"(^|\W)" + spot.sig + r"($|\W)(" + ANY_SIG_REF_REGEX + r")($|\W)", spot.comment, re.IGNORECASE)
|
||||
if sig_ref_match:
|
||||
spot.sig_refs = [sig_ref_match.group(3).upper()]
|
||||
|
||||
# Add to our list
|
||||
self.submit(spot)
|
||||
|
||||
Reference in New Issue
Block a user