mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 14:27:42 +00:00
Now that SIGs are rebranded as Activities, we can merge DXpedition and Contest into that without it being too weird, and get rid of AlertType #147
This commit is contained in:
@@ -11,6 +11,15 @@ def get_ref_regex_for_activity(activity):
|
||||
return None
|
||||
|
||||
|
||||
def get_icon_for_activity(activity):
|
||||
"""Utility function to get the icon for a named activity. If no match is found, None will be returned."""
|
||||
|
||||
for a in ACTIVITIES:
|
||||
if a.name.upper() == activity.upper():
|
||||
return a.icon
|
||||
return None
|
||||
|
||||
|
||||
def get_activity_name_from_comment_name(activity):
|
||||
"""Utility function to get the name of an activity from its "comment name". Generally these will be the same
|
||||
but there are some cases (e.g. is "TOTA" Towers, Tiles or Toilets?) where we need to transform one to the
|
||||
|
||||
@@ -12,6 +12,22 @@ HAMQTH_PRG = f"Spothole v{SOFTWARE_VERSION} operated by {SERVER_OWNER_CALLSIGN}"
|
||||
|
||||
# Activities
|
||||
ACTIVITIES = [
|
||||
Activity(
|
||||
name="Contest",
|
||||
comment_names=["CONTEST"],
|
||||
description="Contest",
|
||||
sig_type=ActivityType.TRADITIONAL,
|
||||
icon="fa-trophy",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
Activity(
|
||||
name="DXpedition",
|
||||
comment_names=[],
|
||||
description="Radio expedition to a remote location",
|
||||
sig_type=ActivityType.TRADITIONAL,
|
||||
icon="fa-book-atlas",
|
||||
refs_globally_unique=False,
|
||||
),
|
||||
Activity(
|
||||
name="Satellite",
|
||||
comment_names=[],
|
||||
|
||||
@@ -112,15 +112,6 @@ class ActivityRefType(str, Enum):
|
||||
TOILET = "TOILET"
|
||||
|
||||
|
||||
class AlertType(str, Enum):
|
||||
"""Type of an alert."""
|
||||
|
||||
XOTA = "XOTA"
|
||||
SATELLITE = "SATELLITE"
|
||||
DXPEDITION = "DXPEDITION"
|
||||
CONTEST = "CONTEST"
|
||||
|
||||
|
||||
class ActivityType(str, Enum):
|
||||
"""Type of an activity. Used to group them in the web UI."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user