mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 14:27:42 +00:00
If a spot has no other activity but its DX call does match a call from an ongoing DXpedition, assign that activity to it. Closes #147
This commit is contained in:
@@ -393,6 +393,22 @@ class Spot:
|
|||||||
elif self.dx_call.upper().endswith(ActivityName.MARITIME_MOBILE):
|
elif self.dx_call.upper().endswith(ActivityName.MARITIME_MOBILE):
|
||||||
self.sig = ActivityName.MARITIME_MOBILE
|
self.sig = ActivityName.MARITIME_MOBILE
|
||||||
|
|
||||||
|
# Alright, now let's get really fancy. Check if the DX callsign matches one taking part in a currently
|
||||||
|
# running DXpedition which we know from the alerts list.
|
||||||
|
if self.dx_call and not self.sig:
|
||||||
|
now = datetime.now(pytz.UTC).timestamp()
|
||||||
|
for alert in DATA_STORE.alerts.values():
|
||||||
|
if (
|
||||||
|
alert.sig == ActivityName.DXPEDITION
|
||||||
|
and alert.dx_calls
|
||||||
|
and alert.start_time
|
||||||
|
and alert.end_time
|
||||||
|
and alert.start_time < now < alert.end_time
|
||||||
|
and self.dx_call.upper() in [c.upper() for c in alert.dx_calls if c]
|
||||||
|
):
|
||||||
|
self.sig = ActivityName.DXPEDITION
|
||||||
|
break
|
||||||
|
|
||||||
# Parse "de_grid -> dx_grid" structures from the comment
|
# Parse "de_grid -> dx_grid" structures from the comment
|
||||||
if self.comment:
|
if self.comment:
|
||||||
grid_mode_grid_match = re.search(
|
grid_mode_grid_match = re.search(
|
||||||
|
|||||||
Reference in New Issue
Block a user