Merge pull request #76 from axelfahy/feat/kwargs-callback

Add kwargs for the callback function
pull/79/head
Meisterschueler 2020-07-23 20:24:08 +02:00 zatwierdzone przez GitHub
commit b8f6db0e2b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -3,6 +3,7 @@
- parser: Changed InReach parser (fixes #73)
- parser: separated incompatible ID into parser dependant ID (lt24: address -> lt24_id, skylines: address -> skylines_id,
spider: id_spider -> spider_registration, address -> spider_id, spot: address -> spot_id) (fixes #64)
- client: Added keyword arguments for the callback function in the 'run' method of the client
## 0.9.7: - 2020-05-21
- parser: Added support for OGPAW (PilotAware) beacons

Wyświetl plik

@ -52,7 +52,7 @@ class AprsClient:
self._kill = True
def run(self, callback, timed_callback=lambda client: None, autoreconnect=False):
def run(self, callback, timed_callback=lambda client: None, autoreconnect=False, **kwargs):
while not self._kill:
try:
keepalive_time = time()
@ -72,7 +72,7 @@ class AprsClient:
self.logger.warning('Read returns zero length string. Failure. Orderly closeout')
break
callback(packet_str)
callback(packet_str, **kwargs)
except ConnectionError:
self.logger.error('ConnectionError', exc_info=True)
except socket.error: