kopia lustrzana https://github.com/glidernet/python-ogn-client
Merge pull request #76 from axelfahy/feat/kwargs-callback
Add kwargs for the callback functionpull/79/head
commit
b8f6db0e2b
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
Ładowanie…
Reference in New Issue