mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-06-24 05:35:10 +00:00
Prevent "TOTA" in cluster comments being flagged as Toilets on the Air, as this is ambiguous
This commit is contained in:
12
data/spot.py
12
data/spot.py
@@ -14,7 +14,6 @@ from core.constants import MODE_ALIASES
|
||||
from core.geo_utils import lat_lon_to_cq_zone, lat_lon_to_itu_zone
|
||||
from core.lookup_helper import lookup_helper, infer_band_from_freq, infer_mode_from_comment, \
|
||||
infer_mode_from_frequency, infer_mode_type_from_mode
|
||||
from data.lookup_credentials import LookupCredentials
|
||||
from core.sig_utils import populate_sig_ref_info, ANY_SIG_REGEX, get_ref_regex_for_sig
|
||||
from data.sig_ref import SIGRef
|
||||
|
||||
@@ -252,9 +251,16 @@ class Spot:
|
||||
if self.comment:
|
||||
sig_matches = re.finditer(r"(^|\W)" + ANY_SIG_REGEX + r"($|\W)", self.comment, re.IGNORECASE)
|
||||
for sig_match in sig_matches:
|
||||
# First of all, if we haven't got a SIG for this spot set yet, now we have. This covers things like cluster
|
||||
# spots where the comment is just "POTA".
|
||||
# See what SIG we think this is
|
||||
found_sig = sig_match.group(2).upper()
|
||||
|
||||
# "TOTA" is now ambiguous, with Toilets and Towers both using it. If we have found "TOTA" in a comment,
|
||||
# ignore it as we can't tell what it is.
|
||||
if found_sig != "TOTA":
|
||||
continue
|
||||
|
||||
# Now, if we haven't got a SIG for this spot set yet, now we have. This covers things like cluster
|
||||
# spots where the comment is just "POTA".
|
||||
if not self.sig:
|
||||
self.sig = found_sig
|
||||
|
||||
|
||||
Reference in New Issue
Block a user