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:
@@ -4,8 +4,8 @@ from datetime import datetime
|
||||
import requests
|
||||
|
||||
from core.constants import HTTP_HEADERS
|
||||
from core.enums import LocationSourceForSpot, Mode, SIGRefType
|
||||
from data.sig_ref import SIGRef
|
||||
from core.enums import ActivityRefType, LocationSourceForSpot, Mode
|
||||
from data.activity_ref import ActivityRef
|
||||
from data.spot import Spot
|
||||
from providers.spot.http_spot_provider import HTTPSpotProvider
|
||||
|
||||
@@ -60,15 +60,15 @@ class Tiles(HTTPSpotProvider):
|
||||
comment=source_spot["notes"],
|
||||
sig="Tiles",
|
||||
# Tiles spots can include POTA & SOTA references, but ignore those on the basis that we will get them separately from the POTA/SOTA providers anyway.
|
||||
# Just take the grid reference itself as the single Tiles SIG reference.
|
||||
# Just take the grid reference itself as the single Tiles activity reference.
|
||||
sig_refs=[
|
||||
SIGRef(
|
||||
ActivityRef(
|
||||
id=source_spot["maidenhead_grid"],
|
||||
sig="Tiles",
|
||||
name=source_spot["maidenhead_grid"],
|
||||
latitude=source_spot["latitude"],
|
||||
longitude=source_spot["longitude"],
|
||||
ref_type=SIGRefType.GRID
|
||||
ref_type=ActivityRefType.GRID
|
||||
)
|
||||
],
|
||||
time=datetime.fromisoformat(source_spot["created_at"].replace("Z", "+00:00")).timestamp(),
|
||||
@@ -83,8 +83,8 @@ class Tiles(HTTPSpotProvider):
|
||||
new_spots.append(spot)
|
||||
return new_spots
|
||||
|
||||
def can_submit_spot(self, sig):
|
||||
return sig == "Tiles"
|
||||
def can_submit_spot(self, activity):
|
||||
return activity == "Tiles"
|
||||
|
||||
def submit_spot(self, spot, credentials):
|
||||
# Tiles on the air currently only supports *self* spots
|
||||
|
||||
Reference in New Issue
Block a user