diff --git a/aprsd/packets/tracker.py b/aprsd/packets/tracker.py index ac5d4b4..b512320 100644 --- a/aprsd/packets/tracker.py +++ b/aprsd/packets/tracker.py @@ -62,14 +62,6 @@ class PacketTrack(objectstore.ObjectStoreMixin): def __len__(self): return len(self.data) - @wrapt.synchronized(lock) - def __str__(self): - result = "{" - for key in self.data.keys(): - result += f"{key}: {str(self.data[key])}, " - result += "}" - return result - @wrapt.synchronized(lock) def add(self, packet): key = packet.msgNo @@ -78,13 +70,14 @@ class PacketTrack(objectstore.ObjectStoreMixin): @wrapt.synchronized(lock) def get(self, key): - if key in self.data: - return self.data[key] + return self.data.get(key, None) @wrapt.synchronized(lock) def remove(self, key): - if key in self.data.keys(): + try: del self.data[key] + except KeyError: + pass def restart(self): """Walk the list of messages and restart them if any.""" diff --git a/aprsd/utils/counter.py b/aprsd/utils/counter.py index e423bfb..5f569f4 100644 --- a/aprsd/utils/counter.py +++ b/aprsd/utils/counter.py @@ -37,7 +37,7 @@ class PacketCounter: @property @wrapt.synchronized(lock) def value(self): - return self.val.value + return str(self.val.value) @wrapt.synchronized(lock) def __repr__(self):