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:
@@ -3,6 +3,7 @@ from datetime import datetime
|
||||
import pytz
|
||||
|
||||
from core.enums import Mode
|
||||
from core.enums import ActivityName
|
||||
from data.activity_ref import ActivityRef
|
||||
from data.spot import Spot
|
||||
from providers.spot.http_spot_provider import HTTPSpotProvider
|
||||
@@ -35,11 +36,11 @@ class ZLOTA(HTTPSpotProvider):
|
||||
freq=freq_hz,
|
||||
mode=Mode.from_name(source_spot["mode"].upper().strip()),
|
||||
comment=source_spot["comments"],
|
||||
sig="ZLOTA",
|
||||
sig=ActivityName.ZLOTA,
|
||||
sig_refs=[
|
||||
ActivityRef(
|
||||
id=source_spot["reference"],
|
||||
sig="ZLOTA",
|
||||
sig=ActivityName.ZLOTA,
|
||||
name=source_spot["name"],
|
||||
)
|
||||
],
|
||||
@@ -52,7 +53,7 @@ class ZLOTA(HTTPSpotProvider):
|
||||
return new_spots
|
||||
|
||||
def can_submit_spot(self, activity):
|
||||
return activity == "ZLOTA"
|
||||
return activity == ActivityName.ZLOTA
|
||||
|
||||
def submit_spot(self, spot, credentials):
|
||||
# TODO: Implement. Spotting to ZLOTA is supported via POST, see https://ontheair.nz/api
|
||||
|
||||
Reference in New Issue
Block a user