mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 14:27:42 +00:00
Refactor activity names to use an enum instead of a string to avoid typos #147
This commit is contained in:
@@ -90,6 +90,60 @@ class LocationSourceForCallsign(str, Enum):
|
||||
DXCC = "DXCC"
|
||||
|
||||
|
||||
# Definitions of every activity Spothole knows about, keyed by the ActivityName enum. An enum is used for the
|
||||
# names to avoid typos when using literal strings like "POTA" all over the place.
|
||||
class ActivityName(str, Enum):
|
||||
"""Canonical name of every activity. Spothole uses these rather than literals like "POTA" around the code
|
||||
to ensure I don't accidentally introduce typos."""
|
||||
|
||||
CONTEST = "Contest"
|
||||
DXPEDITION = "DXpedition"
|
||||
SATELLITE = "Satellite"
|
||||
EME = "EME"
|
||||
AERONAUTICAL_MOBILE = "/AM"
|
||||
MARITIME_MOBILE = "/MM"
|
||||
QRP = "QRP"
|
||||
POTA = "POTA"
|
||||
SOTA = "SOTA"
|
||||
WWFF = "WWFF"
|
||||
GMA = "GMA"
|
||||
WWBOTA = "WWBOTA"
|
||||
HEMA = "HEMA"
|
||||
IOTA = "IOTA"
|
||||
GMA_ISLANDS = "GMA Islands"
|
||||
ARLHS = "ARLHS"
|
||||
ILLW = "ILLW"
|
||||
MOTA = "MOTA"
|
||||
SIOTA = "SIOTA"
|
||||
WCA = "WCA"
|
||||
ZLOTA = "ZLOTA"
|
||||
WOTA = "WOTA"
|
||||
BOTA = "BOTA"
|
||||
KRMNPA = "KRMNPA"
|
||||
SANPCPA = "SANPCPA"
|
||||
LLOTA = "LLOTA"
|
||||
TOWERS = "Towers"
|
||||
TILES = "Tiles"
|
||||
RADAR_RALLY = "RaDAR Rally"
|
||||
WAB = "WAB"
|
||||
WAI = "WAI"
|
||||
DMF = "DMF"
|
||||
DME = "DME"
|
||||
FEA = "FEA"
|
||||
DMUE = "DMUE"
|
||||
DMVE = "DMVE"
|
||||
DCE = "DCE"
|
||||
DEFE = "DEFE"
|
||||
DTMBA = "DTMBA"
|
||||
BIWOTA = "BIWOTA"
|
||||
COTA = "COTA"
|
||||
PGA = "PGA"
|
||||
TOILETS = "Toilets"
|
||||
|
||||
def __str__(self):
|
||||
return str(self.value)
|
||||
|
||||
|
||||
class ActivityRefType(str, Enum):
|
||||
"""Type of an activity reference."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user