mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 08:49:27 +00:00
Ass WAB/WAI SIGs and extract data from cluster spots. Closes #51
This commit is contained in:
@@ -11,20 +11,22 @@ HTTP_HEADERS = {"User-Agent": SOFTWARE_NAME + ", v" + SOFTWARE_VERSION + " (oper
|
||||
|
||||
# Special Interest Groups
|
||||
SIGS = [
|
||||
SIG(name="POTA", description="Parks on the Air", icon="tree"),
|
||||
SIG(name="SOTA", description="Summits on the Air", icon="mountain-sun"),
|
||||
SIG(name="WWFF", description="World Wide Flora & Fauna", icon="seedling"),
|
||||
SIG(name="GMA", description="Global Mountain Activity", icon="person-hiking"),
|
||||
SIG(name="WWBOTA", description="Worldwide Bunkers on the Air", icon="radiation"),
|
||||
SIG(name="HEMA", description="HuMPs Excluding Marilyns Award", icon="mound"),
|
||||
SIG(name="IOTA", description="Islands on the Air", icon="umbrella-beach"),
|
||||
SIG(name="MOTA", description="Mills on the Air", icon="fan"),
|
||||
SIG(name="ARLHS", description="Amateur Radio Lighthouse Society", icon="tower-observation"),
|
||||
SIG(name="ILLW", description="International Lighthouse & Lightship Weekend", icon="tower-observation"),
|
||||
SIG(name="SIOTA", description="Silos on the Air", icon="wheat-awn"),
|
||||
SIG(name="WCA", description="World Castles Award", icon="chess-rook"),
|
||||
SIG(name="ZLOTA", description="New Zealand on the Air", icon="kiwi-bird"),
|
||||
SIG(name="KRMNPA", description="Keith Roget Memorial National Parks Award", icon="earth-oceania")
|
||||
SIG(name="POTA", description="Parks on the Air", icon="tree", ref_regex=r"[A-Z]{2}\-\d+"),
|
||||
SIG(name="SOTA", description="Summits on the Air", icon="mountain-sun", ref_regex=r"[A-Z0-9]{1,3}\/[A-Z]{2}\-\d+"),
|
||||
SIG(name="WWFF", description="World Wide Flora & Fauna", icon="seedling", ref_regex=r"[A-Z0-9]{1,3}FF\-\d+"),
|
||||
SIG(name="GMA", description="Global Mountain Activity", icon="person-hiking", ref_regex=r"[A-Z0-9]{1,3}\/[A-Z]{2}\-\d+"),
|
||||
SIG(name="WWBOTA", description="Worldwide Bunkers on the Air", icon="radiation", ref_regex=r"B\/[A-Z0-9]{1,3}\-\d+"),
|
||||
SIG(name="HEMA", description="HuMPs Excluding Marilyns Award", icon="mound", ref_regex=r"[A-Z0-9]{1,3}\/[A-Z]{3}\-\d+"),
|
||||
SIG(name="IOTA", description="Islands on the Air", icon="umbrella-beach", ref_regex=r"[A-Z]{2}\-\d+"),
|
||||
SIG(name="MOTA", description="Mills on the Air", icon="fan", ref_regex=r"X\d{4-6}"),
|
||||
SIG(name="ARLHS", description="Amateur Radio Lighthouse Society", icon="tower-observation", ref_regex=r"[A-Z]{3}\-\d+"),
|
||||
SIG(name="ILLW", description="International Lighthouse & Lightship Weekend", icon="tower-observation", ref_regex=r"[A-Z]{2}\d{4}"),
|
||||
SIG(name="SIOTA", description="Silos on the Air", icon="wheat-awn", ref_regex=r"[A-Z]{2}\-[A-Z]{3}\d"),
|
||||
SIG(name="WCA", description="World Castles Award", icon="chess-rook", ref_regex=r"[A-Z0-9]{1,3}\-\d+"),
|
||||
SIG(name="ZLOTA", description="New Zealand on the Air", icon="kiwi-bird", ref_regex=r"ZL[A-Z]/[A-Z]{2}\-\d+"),
|
||||
SIG(name="KRMNPA", description="Keith Roget Memorial National Parks Award", icon="earth-oceania", ref_regex=r""),
|
||||
SIG(name="WAB", description="Worked All Britain", icon="table-cells-large", ref_regex=r"[A-Z]{2}[0-9]{2}"),
|
||||
SIG(name="WAI", description="Worked All Ireland", icon="table-cells-large", ref_regex=r"[A-Z][0-9]{2}")
|
||||
]
|
||||
|
||||
# Modes. Note "DIGI" and "DIGITAL" are also supported but are normalised into "DATA".
|
||||
|
||||
@@ -7,8 +7,15 @@ def get_icon_for_sig(sig):
|
||||
return s.icon
|
||||
return "circle-question"
|
||||
|
||||
# Utility function to get the regex string for a SIG reference for a named SIG. If no match is found, None will be returned.
|
||||
def get_ref_regex_for_sig(sig):
|
||||
for s in SIGS:
|
||||
if s.name == sig:
|
||||
return s.ref_regex
|
||||
return None
|
||||
|
||||
# Regex matching any SIG
|
||||
ANY_SIG_REGEX = r"(" + r"|".join(list(map(lambda p: p.name, SIGS))) + r")"
|
||||
|
||||
# Regex matching any SIG reference
|
||||
ANY_SIG_REF_REGEX = r"[\w\/]+\-\d+"
|
||||
ANY_XOTA_SIG_REF_REGEX = r"[\w\/]+\-\d+"
|
||||
Reference in New Issue
Block a user