mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 14:27:42 +00:00
Code review fixes
This commit is contained in:
+1
-1
@@ -158,7 +158,7 @@ class Alert:
|
||||
self.icon = "fa-globe-africa"
|
||||
elif self.alert_type == AlertType.CONTEST:
|
||||
self.icon = "fa-trophy"
|
||||
elif self.alert_type == AlertType.CONTEST:
|
||||
elif self.alert_type == AlertType.SATELLITE:
|
||||
self.icon = "fa-satellite"
|
||||
elif self.sig_refs and self.sig_refs[0].icon:
|
||||
self.icon = self.sig_refs[0].icon
|
||||
|
||||
+14
-2
@@ -12,6 +12,7 @@ from pyhamtools.locator import latlong_to_locator, locator_to_latlong
|
||||
from core.call_lookup_helper import get_call_info
|
||||
from core.config import MAX_SPOT_AGE
|
||||
from core.constants import PROPAGATION_MODES, SIGS
|
||||
from core.data_store import DATA_STORE
|
||||
from core.enums import Continent, LocationSourceForSpot, Mode, ModeSource, ModeType
|
||||
from core.geo_utils import lat_lon_to_cq_zone, lat_lon_to_itu_zone
|
||||
from core.sig_lookup_helper import populate_missing_sig_ref_info
|
||||
@@ -363,11 +364,13 @@ class Spot:
|
||||
if self.propagation_mode == "Satellite":
|
||||
if not self.sig:
|
||||
self.sig = "AMSAT"
|
||||
self.sig_refs.append(SIGRef(sig="AMSAT"))
|
||||
if not any(sig_ref.sig == "AMSAT" for sig_ref in self.sig_refs):
|
||||
self.sig_refs.append(SIGRef(sig="AMSAT"))
|
||||
if self.propagation_mode == "Earth-Moon-Earth":
|
||||
if not self.sig:
|
||||
self.sig = "EME"
|
||||
self.sig_refs.append(SIGRef(sig="EME"))
|
||||
if not any(sig_ref.sig == "EME" for sig_ref in self.sig_refs):
|
||||
self.sig_refs.append(SIGRef(sig="EME"))
|
||||
|
||||
# Parse "de_grid -> dx_grid" structures from the comment
|
||||
if self.comment:
|
||||
@@ -445,6 +448,15 @@ class Spot:
|
||||
elif self.dx_call:
|
||||
self.dx_itu_zone = dx_call_info.itu_zone
|
||||
|
||||
# DXCC lookup from callsign if nothing else has provided it
|
||||
if self.dx_call and not self.dx_dxcc_id:
|
||||
for regex, entity_code in DATA_STORE.dxcc_lookup_by_call_regex:
|
||||
if regex.pattern and regex.match(self.dx_call):
|
||||
self.dx_dxcc_id = entity_code
|
||||
break
|
||||
if self.dx_dxcc_id and not self.dx_flag:
|
||||
self.dx_flag = get_flag_for_dxcc(self.dx_dxcc_id)
|
||||
|
||||
# DX Location is "good" if it is from a spot, or from QRZ if the callsign doesn't contain a slash, so the operator
|
||||
# is likely at home.
|
||||
self.dx_location_good = bool(
|
||||
|
||||
Reference in New Issue
Block a user