mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 14:27:42 +00:00
Giant refactor to rebrand "SIG" as "Activity" anywhere that doesn't touch API or config file (which is to be addressed in a future breaking change). #147
This commit is contained in:
+113
-113
@@ -1,7 +1,7 @@
|
||||
from core.config import SERVER_OWNER_CALLSIGN
|
||||
from core.enums import SIGRefType, SIGType
|
||||
from core.enums import ActivityRefType, ActivityType
|
||||
from data.activity import Activity
|
||||
from data.band import Band
|
||||
from data.sig import SIG
|
||||
|
||||
# General software
|
||||
SOFTWARE_VERSION = "2.1"
|
||||
@@ -10,387 +10,387 @@ SOFTWARE_VERSION = "2.1"
|
||||
HTTP_HEADERS = {"User-Agent": f"Spothole v{SOFTWARE_VERSION} (operated by {SERVER_OWNER_CALLSIGN})"}
|
||||
HAMQTH_PRG = f"Spothole v{SOFTWARE_VERSION} operated by {SERVER_OWNER_CALLSIGN}".replace(" ", "_")
|
||||
|
||||
# Special Interest Groups
|
||||
SIGS = [
|
||||
SIG(
|
||||
# Activities
|
||||
ACTIVITIES = [
|
||||
Activity(
|
||||
name="AMSAT",
|
||||
comment_names=[],
|
||||
description="Amateur Radio Satellites",
|
||||
sig_type=SIGType.WORLDWIDE,
|
||||
sig_type=ActivityType.WORLDWIDE,
|
||||
icon="fa-satellite",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="EME",
|
||||
comment_names=[],
|
||||
description="Moonbounce",
|
||||
sig_type=SIGType.WORLDWIDE,
|
||||
sig_type=ActivityType.WORLDWIDE,
|
||||
icon="fa-moon",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="POTA",
|
||||
comment_names=["POTA"],
|
||||
description="Parks on the Air",
|
||||
sig_type=SIGType.WORLDWIDE,
|
||||
ref_type=SIGRefType.PARK,
|
||||
sig_type=ActivityType.WORLDWIDE,
|
||||
ref_type=ActivityRefType.PARK,
|
||||
ref_regex=r"[A-Z]{2}\-\d{4,5}|K\-TEST",
|
||||
icon="fa-tree",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="SOTA",
|
||||
comment_names=["SOTA"],
|
||||
description="Summits on the Air",
|
||||
sig_type=SIGType.WORLDWIDE,
|
||||
ref_type=SIGRefType.SUMMIT,
|
||||
sig_type=ActivityType.WORLDWIDE,
|
||||
ref_type=ActivityRefType.SUMMIT,
|
||||
ref_regex=r"[A-Z0-9]{1,3}\/[A-Z]{2}\-\d{3}",
|
||||
icon="fa-mountain-sun",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="WWFF",
|
||||
comment_names=["WWFF"],
|
||||
description="World Wide Flora & Fauna",
|
||||
sig_type=SIGType.WORLDWIDE,
|
||||
ref_type=SIGRefType.PARK,
|
||||
sig_type=ActivityType.WORLDWIDE,
|
||||
ref_type=ActivityRefType.PARK,
|
||||
ref_regex=r"[A-Z0-9]{1,3}FF\-\d{4}",
|
||||
icon="fa-seedling",
|
||||
refs_globally_unique=True,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="GMA",
|
||||
comment_names=["GMA"],
|
||||
description="Global Mountain Activity",
|
||||
sig_type=SIGType.WORLDWIDE,
|
||||
ref_type=SIGRefType.SUMMIT,
|
||||
sig_type=ActivityType.WORLDWIDE,
|
||||
ref_type=ActivityRefType.SUMMIT,
|
||||
ref_regex=r"[A-Z0-9]{1,3}\/[A-Z]{2}\-\d{3}",
|
||||
icon="fa-person-hiking",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="WWBOTA",
|
||||
comment_names=["WWBOTA", "BOTA"],
|
||||
description="Worldwide Bunkers on the Air",
|
||||
sig_type=SIGType.WORLDWIDE,
|
||||
ref_type=SIGRefType.BUNKER,
|
||||
sig_type=ActivityType.WORLDWIDE,
|
||||
ref_type=ActivityRefType.BUNKER,
|
||||
ref_regex=r"B\/[A-Z0-9]{1,3}\-\d{3,4}",
|
||||
icon="fa-radiation",
|
||||
refs_globally_unique=True,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="HEMA",
|
||||
comment_names=["HEMA"],
|
||||
description="HuMPs Excluding Marilyns Award",
|
||||
sig_type=SIGType.WORLDWIDE,
|
||||
ref_type=SIGRefType.SUMMIT,
|
||||
sig_type=ActivityType.WORLDWIDE,
|
||||
ref_type=ActivityRefType.SUMMIT,
|
||||
ref_regex=r"[A-Z0-9]{1,3}\/[A-Z]{3}\-\d{3}",
|
||||
icon="fa-mound",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="IOTA",
|
||||
comment_names=["IOTA"],
|
||||
description="Islands on the Air",
|
||||
sig_type=SIGType.WORLDWIDE,
|
||||
ref_type=SIGRefType.ISLAND,
|
||||
sig_type=ActivityType.WORLDWIDE,
|
||||
ref_type=ActivityRefType.ISLAND,
|
||||
ref_regex=r"[A-Z]{2}\-\d{3}",
|
||||
icon="fa-book-atlas",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="GMA Islands",
|
||||
comment_names=[],
|
||||
description="Global Mountain Activity - Islands",
|
||||
sig_type=SIGType.WORLDWIDE,
|
||||
ref_type=SIGRefType.ISLAND,
|
||||
sig_type=ActivityType.WORLDWIDE,
|
||||
ref_type=ActivityRefType.ISLAND,
|
||||
ref_regex=r"(([A-Z]{2}\-\d{3})|([A-Z0-9]{1,3}\/[A-Z]{2}\-\d{3}))",
|
||||
icon="fa-person-hiking",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="ARLHS",
|
||||
comment_names=["ARLHS"],
|
||||
description="Amateur Radio Lighthouse Society",
|
||||
sig_type=SIGType.WORLDWIDE,
|
||||
ref_type=SIGRefType.LIGHTHOUSE,
|
||||
sig_type=ActivityType.WORLDWIDE,
|
||||
ref_type=ActivityRefType.LIGHTHOUSE,
|
||||
ref_regex=r"[A-Z]{3}[\- ]\d{3,4}",
|
||||
icon="fa-house-flood-water",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="ILLW",
|
||||
comment_names=["ILLW"],
|
||||
description="International Lighthouse & Lightship Weekend",
|
||||
sig_type=SIGType.EVENT,
|
||||
ref_type=SIGRefType.LIGHTHOUSE,
|
||||
sig_type=ActivityType.EVENT,
|
||||
ref_type=ActivityRefType.LIGHTHOUSE,
|
||||
ref_regex=r"[A-Z]{2}\d{4}",
|
||||
icon="fa-house-flood-water",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="MOTA",
|
||||
comment_names=["MOTA"],
|
||||
description="Mills on the Air",
|
||||
sig_type=SIGType.EVENT,
|
||||
ref_type=SIGRefType.MILL,
|
||||
sig_type=ActivityType.EVENT,
|
||||
ref_type=ActivityRefType.MILL,
|
||||
ref_regex=r"X\d{4,6}",
|
||||
icon="fa-fan",
|
||||
refs_globally_unique=True,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="SIOTA",
|
||||
comment_names=["SIOTA"],
|
||||
description="Silos on the Air",
|
||||
sig_type=SIGType.WORLDWIDE,
|
||||
ref_type=SIGRefType.SILO,
|
||||
sig_type=ActivityType.WORLDWIDE,
|
||||
ref_type=ActivityRefType.SILO,
|
||||
ref_regex=r"[A-Z]{2}\-[A-Z]{3}\d",
|
||||
icon="fa-wheat-awn",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="WCA",
|
||||
comment_names=["WCA"],
|
||||
description="World Castles Award",
|
||||
sig_type=SIGType.WORLDWIDE,
|
||||
ref_type=SIGRefType.CASTLE,
|
||||
sig_type=ActivityType.WORLDWIDE,
|
||||
ref_type=ActivityRefType.CASTLE,
|
||||
ref_regex=r"[A-Z0-9]{1,3}\-\d{5}",
|
||||
icon="fa-chess-rook",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="ZLOTA",
|
||||
comment_names=["ZLOTA"],
|
||||
description="New Zealand on the Air",
|
||||
sig_type=SIGType.REGIONAL,
|
||||
sig_type=ActivityType.REGIONAL,
|
||||
ref_type=None,
|
||||
ref_regex=r"ZL[A-Z]/[A-Z]{2}\-\d{3,4}",
|
||||
icon="fa-kiwi-bird",
|
||||
region_flag="🇳🇿",
|
||||
refs_globally_unique=True,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="WOTA",
|
||||
comment_names=["WOTA"],
|
||||
description="Wainwrights on the Air",
|
||||
sig_type=SIGType.REGIONAL,
|
||||
ref_type=SIGRefType.SUMMIT,
|
||||
sig_type=ActivityType.REGIONAL,
|
||||
ref_type=ActivityRefType.SUMMIT,
|
||||
ref_regex=r"[A-Z]{3}-[0-9]{2}",
|
||||
icon="fa-w",
|
||||
region_flag="🇬🇧",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="BOTA",
|
||||
comment_names=[],
|
||||
description="Beaches on the Air",
|
||||
sig_type=SIGType.WORLDWIDE,
|
||||
ref_type=SIGRefType.BEACH,
|
||||
sig_type=ActivityType.WORLDWIDE,
|
||||
ref_type=ActivityRefType.BEACH,
|
||||
icon="fa-umbrella-beach",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="KRMNPA",
|
||||
comment_names=["KRMNPA"],
|
||||
description="Keith Roget Memorial National Parks Award",
|
||||
sig_type=SIGType.REGIONAL,
|
||||
ref_type=SIGRefType.PARK,
|
||||
sig_type=ActivityType.REGIONAL,
|
||||
ref_type=ActivityRefType.PARK,
|
||||
ref_regex=r"VKFF\-\d{4}",
|
||||
icon="fa-earth-oceania",
|
||||
region_flag="🇦🇺",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="SANPCPA",
|
||||
comment_names=["SANPCPA"],
|
||||
description="South Australian National Parks and Conservation Parks Award",
|
||||
sig_type=SIGType.REGIONAL,
|
||||
ref_type=SIGRefType.PARK,
|
||||
sig_type=ActivityType.REGIONAL,
|
||||
ref_type=ActivityRefType.PARK,
|
||||
ref_regex=r"VKFF\-\d{4}",
|
||||
icon="fa-earth-oceania",
|
||||
region_flag="🇦🇺",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="LLOTA",
|
||||
comment_names=["LLOTA"],
|
||||
description="Lagos y Lagunas on the Air",
|
||||
sig_type=SIGType.WORLDWIDE,
|
||||
ref_type=SIGRefType.LAKE,
|
||||
sig_type=ActivityType.WORLDWIDE,
|
||||
ref_type=ActivityRefType.LAKE,
|
||||
ref_regex=r"LL[A-Z]{2}\-\d{4}",
|
||||
icon="fa-water",
|
||||
refs_globally_unique=True,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="Towers",
|
||||
comment_names=["TOTA"],
|
||||
description="Towers on the Air",
|
||||
sig_type=SIGType.WORLDWIDE,
|
||||
ref_type=SIGRefType.TOWER,
|
||||
sig_type=ActivityType.WORLDWIDE,
|
||||
ref_type=ActivityRefType.TOWER,
|
||||
ref_regex=r"[A-Z]{2,3}R\-\d{4}",
|
||||
icon="fa-tower-observation",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="Tiles",
|
||||
comment_names=[],
|
||||
description="Tiles on the Air",
|
||||
sig_type=SIGType.WORLDWIDE,
|
||||
ref_type=SIGRefType.GRID,
|
||||
sig_type=ActivityType.WORLDWIDE,
|
||||
ref_type=ActivityRefType.GRID,
|
||||
ref_regex=r"[A-Za-z]{2}[0-9]{2}[A-Za-z]{2}",
|
||||
icon="fa-square",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="WAB",
|
||||
comment_names=["WAB"],
|
||||
description="Worked All Britain",
|
||||
sig_type=SIGType.REGIONAL,
|
||||
ref_type=SIGRefType.GRID,
|
||||
sig_type=ActivityType.REGIONAL,
|
||||
ref_type=ActivityRefType.GRID,
|
||||
ref_regex=r"[A-Z]{1,2}[0-9]{2}",
|
||||
icon="fa-table-cells-large",
|
||||
region_flag="🇬🇧",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="WAI",
|
||||
comment_names=["WAI"],
|
||||
description="Worked All Ireland",
|
||||
sig_type=SIGType.REGIONAL,
|
||||
ref_type=SIGRefType.GRID,
|
||||
sig_type=ActivityType.REGIONAL,
|
||||
ref_type=ActivityRefType.GRID,
|
||||
ref_regex=r"[A-Z][0-9]{2}",
|
||||
icon="fa-table-cells-large",
|
||||
region_flag="🇮🇪",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="DMF",
|
||||
comment_names=["DMF"],
|
||||
description="Diplôme des Moulins de France",
|
||||
sig_type=SIGType.REGIONAL,
|
||||
ref_type=SIGRefType.MILL,
|
||||
sig_type=ActivityType.REGIONAL,
|
||||
ref_type=ActivityRefType.MILL,
|
||||
icon="fa-fan",
|
||||
region_flag="🇫🇷",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="DME",
|
||||
comment_names=["DME"],
|
||||
description="Diploma Municipios de España",
|
||||
sig_type=SIGType.REGIONAL,
|
||||
ref_type=SIGRefType.TOWN,
|
||||
sig_type=ActivityType.REGIONAL,
|
||||
ref_type=ActivityRefType.TOWN,
|
||||
ref_regex=r"DME[\- ]\d{3,5}",
|
||||
icon="fa-building",
|
||||
region_flag="🇪🇸",
|
||||
refs_globally_unique=True,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="FEA",
|
||||
comment_names=["FEA"],
|
||||
description="Diploma Faros de España",
|
||||
sig_type=SIGType.REGIONAL,
|
||||
ref_type=SIGRefType.LIGHTHOUSE,
|
||||
sig_type=ActivityType.REGIONAL,
|
||||
ref_type=ActivityRefType.LIGHTHOUSE,
|
||||
# FEA references are technically [DE]\-\d{4}(\.\d)? but spotters always seem to miss out the D- or E-
|
||||
# prefix and just use FEA-1234 or FEA 1234, so allow for that. The FEA sigref data provider adds both
|
||||
# prefix and just use FEA-1234 or FEA 1234, so allow for that. The FEA activity ref data provider adds both
|
||||
# forms to the database.
|
||||
ref_regex=r"([DE]|FEA)[\- ]\d{4}(\.\d)?",
|
||||
icon="fa-house-flood-water",
|
||||
region_flag="🇪🇸",
|
||||
refs_globally_unique=True,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="DMUE",
|
||||
comment_names=["DMUE"],
|
||||
description="Diploma Museos de España",
|
||||
sig_type=SIGType.REGIONAL,
|
||||
ref_type=SIGRefType.BUILDING,
|
||||
sig_type=ActivityType.REGIONAL,
|
||||
ref_type=ActivityRefType.BUILDING,
|
||||
ref_regex=r"MUE[A-Z]{2}-\d{3}",
|
||||
icon="fa-landmark",
|
||||
region_flag="🇪🇸",
|
||||
refs_globally_unique=True,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="DMVE",
|
||||
comment_names=["DMVE"],
|
||||
description="Diploma Monumentos y Vestigios de España",
|
||||
sig_type=SIGType.REGIONAL,
|
||||
ref_type=SIGRefType.BUILDING,
|
||||
sig_type=ActivityType.REGIONAL,
|
||||
ref_type=ActivityRefType.BUILDING,
|
||||
ref_regex=r"MV[A-Z]{1,2}-\d{4}",
|
||||
icon="fa-monument",
|
||||
region_flag="🇪🇸",
|
||||
refs_globally_unique=True,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="DCE",
|
||||
comment_names=["DCE"],
|
||||
description="Diploma Castillos de España",
|
||||
sig_type=SIGType.REGIONAL,
|
||||
ref_type=SIGRefType.CASTLE,
|
||||
sig_type=ActivityType.REGIONAL,
|
||||
ref_type=ActivityRefType.CASTLE,
|
||||
ref_regex=r"C[A-Z]{1,2}-\d{3}",
|
||||
icon="fa-chess-rook",
|
||||
region_flag="🇪🇸",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="DEFE",
|
||||
comment_names=["DEFE"],
|
||||
description="Diploma Estaciones de Ferrocarril de España",
|
||||
sig_type=SIGType.REGIONAL,
|
||||
ref_type=SIGRefType.BUILDING,
|
||||
sig_type=ActivityType.REGIONAL,
|
||||
ref_type=ActivityRefType.BUILDING,
|
||||
ref_regex=r"EF[A-Z]{1,2}-\d{3}",
|
||||
icon="fa-train",
|
||||
region_flag="🇪🇸",
|
||||
refs_globally_unique=True,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="DTMBA",
|
||||
comment_names=["DTMBA"],
|
||||
description="Diploma Teatri Musei e Belle Arti",
|
||||
sig_type=SIGType.REGIONAL,
|
||||
ref_type=SIGRefType.BUILDING,
|
||||
sig_type=ActivityType.REGIONAL,
|
||||
ref_type=ActivityRefType.BUILDING,
|
||||
ref_regex=r"I-?[0-9]{3,4}\s?[A-Z]{2}",
|
||||
icon="fa-landmark",
|
||||
region_flag="🇮🇹",
|
||||
refs_globally_unique=True,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="BIWOTA",
|
||||
comment_names=["BIWOTA"],
|
||||
description="British Inland Waterways on the Air",
|
||||
sig_type=SIGType.EVENT,
|
||||
ref_type=SIGRefType.WATERWAY,
|
||||
sig_type=ActivityType.EVENT,
|
||||
ref_type=ActivityRefType.WATERWAY,
|
||||
icon="fa-ship",
|
||||
region_flag="🇬🇧",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="COTA",
|
||||
comment_names=["COTA"],
|
||||
description="Castles on the Air",
|
||||
sig_type=SIGType.REGIONAL,
|
||||
ref_type=SIGRefType.CASTLE,
|
||||
sig_type=ActivityType.REGIONAL,
|
||||
ref_type=ActivityRefType.CASTLE,
|
||||
ref_regex=r"[A-Z]{3}\-[0-9]{3,5}",
|
||||
icon="fa-chess-rook",
|
||||
region_flag="🇩🇪",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="PGA",
|
||||
comment_names=["PGA"],
|
||||
description="Polish Gmina Award",
|
||||
sig_type=SIGType.REGIONAL,
|
||||
ref_type=SIGRefType.REGION,
|
||||
sig_type=ActivityType.REGIONAL,
|
||||
ref_type=ActivityRefType.REGION,
|
||||
ref_regex=r"[A-Z]{2}[0-9]{2}",
|
||||
icon="fa-g",
|
||||
region_flag="🇵🇱",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
SIG(
|
||||
Activity(
|
||||
name="Toilets",
|
||||
comment_names=[],
|
||||
description="Toilets on the Air",
|
||||
sig_type=SIGType.EVENT,
|
||||
ref_type=SIGRefType.TOILET,
|
||||
sig_type=ActivityType.EVENT,
|
||||
ref_type=ActivityRefType.TOILET,
|
||||
ref_regex=r"T\-[0-9]{2}",
|
||||
icon="fa-toilet",
|
||||
region_flag="🏴☠️",
|
||||
|
||||
Reference in New Issue
Block a user