mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 08:49:27 +00:00
Icon lookup for SIGs in preparation for #47. Improved ZLOTA spotter lookup.
This commit is contained in:
@@ -9,6 +9,7 @@ import pytz
|
||||
|
||||
from core.constants import DXCC_FLAGS
|
||||
from core.lookup_helper import lookup_helper
|
||||
from core.utility_functions import get_icon_for_sig
|
||||
|
||||
|
||||
# Data class that defines an alert.
|
||||
@@ -59,7 +60,7 @@ class Alert:
|
||||
# Activation score. SOTA only
|
||||
activation_score: int = None
|
||||
# Icon, from the Font Awesome set. This is fairly opinionated but is here to help the alerthole web UI and Field alertter. Does not include the "fa-" prefix.
|
||||
icon: str = "question"
|
||||
icon: str = None
|
||||
# Whether this alert is for a DXpedition, as opposed to e.g. an xOTA programme.
|
||||
is_dxpedition: bool = False
|
||||
# Where we got the alert from, e.g. "POTA", "SOTA"...
|
||||
@@ -100,6 +101,10 @@ class Alert:
|
||||
if self.dx_dxcc_id and self.dx_dxcc_id in DXCC_FLAGS and not self.dx_flag:
|
||||
self.dx_flag = DXCC_FLAGS[self.dx_dxcc_id]
|
||||
|
||||
# Icon from SIG
|
||||
if self.sig and not self.icon:
|
||||
self.icon = get_icon_for_sig(self.sig)
|
||||
|
||||
# DX operator details lookup, using QRZ.com. This should be the last resort compared to taking the data from
|
||||
# the actual alertting service, e.g. we don't want to accidentally use a user's QRZ.com home lat/lon instead of
|
||||
# the one from the park reference they're at.
|
||||
|
||||
Reference in New Issue
Block a user