mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 16:59:25 +00:00
SiOTA icon
This commit is contained in:
@@ -29,13 +29,22 @@ class ParksNPeaks(HTTPSpotProvider):
|
|||||||
comment=source_spot["actComments"],
|
comment=source_spot["actComments"],
|
||||||
sig=source_spot["actClass"],
|
sig=source_spot["actClass"],
|
||||||
sig_refs=[source_spot["actSiteID"]],
|
sig_refs=[source_spot["actSiteID"]],
|
||||||
icon="question", # todo determine from actClass
|
|
||||||
time=datetime.strptime(source_spot["actTime"], "%Y-%m-%d %H:%M:%S").replace(tzinfo=pytz.UTC).timestamp())
|
time=datetime.strptime(source_spot["actTime"], "%Y-%m-%d %H:%M:%S").replace(tzinfo=pytz.UTC).timestamp())
|
||||||
|
|
||||||
# If this is POTA, SOTA or WWFF data we already have it through other means, so ignore.
|
# PNP supports a bunch of programs which should have different icons
|
||||||
|
if spot.sig == "SiOTA":
|
||||||
|
spot.icon = "wheat-awn"
|
||||||
|
elif spot.sig in ["POTA", "SOTA", "WWFF"]:
|
||||||
|
# Don't care about an icon as this will be rejected anyway, we have better data from POTA/SOTA/WWFF direct
|
||||||
|
spot.icon = ""
|
||||||
|
else:
|
||||||
|
# Unknown programme we've never seen before
|
||||||
|
logging.warn(
|
||||||
|
"PNP spot found with sig " + spot.sig + ", developer needs to add support for icon and grid/lat/lon lookup!")
|
||||||
|
spot.icon = "question"
|
||||||
|
|
||||||
|
# If this is POTA, SOTA or WWFF data we already have it through other means, so ignore. Otherwise, add to
|
||||||
|
# the spot list.
|
||||||
if spot.sig not in ["POTA", "SOTA", "WWFF"]:
|
if spot.sig not in ["POTA", "SOTA", "WWFF"]:
|
||||||
logging.warn("PNP spot found with sig " + spot.sig + ", developer needs to figure out how to look this up for grid/lat/lon!")
|
|
||||||
# Add to our list. Don't worry about de-duping, removing old spots etc. at this point; other code will do
|
|
||||||
# that for us.
|
|
||||||
new_spots.append(spot)
|
new_spots.append(spot)
|
||||||
return new_spots
|
return new_spots
|
||||||
Reference in New Issue
Block a user