Merge pull request #109 from jaredd/master

Fix python3 error w.r.t. modifying a list in place. Also fix SBS1 interface. Author: Jared Dulmage/github.com/jaredd
master
Nick Foster 4 years ago committed by GitHub
commit 9e2515a566
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -193,11 +193,11 @@ class cpr_decoder:
def weed_poslists(self):
for poslist in [self.evenlist, self.oddlist]:
for key, item in poslist.items():
for key, item in tuple(poslist.items()):
if time.time() - item[2] > 10:
del poslist[key]
for poslist in [self.evenlist_sfc, self.oddlist_sfc]:
for key, item in poslist.items():
for key, item in tuple(poslist.items()):
if time.time() - item[2] > 25:
del poslist[key]

@ -80,7 +80,7 @@ class output_print:
except ADSBError:
return
if msg.data["vs"] is 1:
if msg.data["vs"] == 1:
retstr += " (aircraft is on the ground)"
self._print(retstr)

@ -93,8 +93,9 @@ class output_sbs1:
try:
sbs1_msg = self.parse(msg)
if sbs1_msg is not None:
sbs1_bytes = sbs1_msg.encode('utf-8')
for conn in self._conns[:]: #iterate over a copy of the list
conn.send(sbs1_msg)
conn.send(sbs1_bytes)
except socket.error:
self._conns.remove(conn)
print("Connections: ", len(self._conns))

Loading…
Cancel
Save