Skip to content

Commit

Permalink
try to find station info in database
Browse files Browse the repository at this point in the history
  • Loading branch information
DJ2LS committed Sep 13, 2024
1 parent 66f2978 commit f50cfec
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions freedata_server/frame_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import time
from codec2 import FREEDV_MODE
from message_system_db_manager import DatabaseManager
from message_system_db_station import DatabaseManagerStations

import maidenhead

TESTMODE = False
Expand Down Expand Up @@ -127,6 +129,14 @@ def add_to_heard_stations(self):
return

dxgrid = frame.get('gridsquare', "------")
#try to find station info in database
try:
station = DatabaseManagerStations(self.event_manager).get_station(frame['origin'])
if station and "gridsquare" in station["location"]:
dxgrid = station["location"]["gridsquare"]
except Exception:
pass

Check notice on line 138 in freedata_server/frame_handler.py

View check run for this annotation

codefactor.io / CodeFactor

freedata_server/frame_handler.py#L137-L138

Try, Except, Pass detected. (B110)

# Initialize distance values
distance_km = None
distance_miles = None
Expand Down

0 comments on commit f50cfec

Please sign in to comment.