Skip to content

Commit 663d299

Browse files
switch to teek (#62)
* switch to `teek` * Fix code style issues with oitnb Co-authored-by: Lint Action <[email protected]>
1 parent 8e313a3 commit 663d299

File tree

4 files changed

+161
-162
lines changed

4 files changed

+161
-162
lines changed

packetraven/__main__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,9 @@ def retrieve_packets(
479479

480480
if database is not None:
481481
for packets in new_packets.values():
482-
database.send(packets)
482+
database.send(
483+
packet for packet in packets if packet.source != database.location
484+
)
483485

484486
updated_callsigns = sorted(updated_callsigns)
485487
for callsign in updated_callsigns:
@@ -494,7 +496,7 @@ def retrieve_packets(
494496
f'{coordinate:.3f}°' for coordinate in packet_track.coordinates[-1, :2]
495497
)
496498
logger.info(
497-
f'{callsign:8} - packet #{len(packet_track):<3} - ({coordinate_string}, {packet_track.coordinates[-1, 2]:9.2f}m)'
499+
f'{callsign:9} - packet #{len(packet_track):<3} - ({coordinate_string}, {packet_track.coordinates[-1, 2]:9.2f}m)'
498500
f'; packet time is {packet_time} ({humanize.naturaltime(current_time - packet_time)}, {packet_track.intervals[-1]:6.1f} s interval)'
499501
f'; traveled {packet_track.overground_distances[-1]:6.1f} m ({packet_track.ground_speeds[-1]:5.1f} m/s) over the ground'
500502
f', and {packet_track.ascents[-1]:6.1f} m ({packet_track.ascent_rates[-1]:5.1f} m/s) vertically, since the previous packet'
@@ -510,7 +512,7 @@ def retrieve_packets(
510512
)
511513
try:
512514
message = (
513-
f'{callsign:8} - '
515+
f'{callsign:9} - '
514516
f'altitude: {packet_track.altitudes[-1]:6.1f} m'
515517
f'; avg. ascent rate: {numpy.mean(packet_track.ascent_rates[packet_track.ascent_rates > 0]):5.1f} m/s'
516518
f'; avg. descent rate: {numpy.mean(packet_track.ascent_rates[packet_track.ascent_rates < 0]):5.1f} m/s'

packetraven/connections/internet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def insert(self, packets: [APRSPacket]):
168168
for packet in packets:
169169
if packet.crs != self.crs:
170170
packet.transform_to(self.crs)
171-
records = [self.__packet_record(packet) for packet in packets]
171+
records = [self.__packet_record(packet) for packet in packets if packet not in self]
172172
PostGresTable.insert(self, records)
173173

174174
def __contains__(self, packet: LocationPacket) -> bool:

0 commit comments

Comments
 (0)