Skip to content

Commit 7b29dde

Browse files
authored
Merge pull request #369 from theori-io/python-callback-args
Allow additional callback arguments in Python API
2 parents a4b7883 + dac864c commit 7b29dde

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

support/nrsc5.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -512,12 +512,13 @@ def _callback_wrapper(self, c_evt):
512512
evt = SIS(self._decode(sis.country_code), sis.fcc_facility_id, self._decode(sis.name),
513513
self._decode(sis.slogan), self._decode(sis.message), self._decode(sis.alert),
514514
latitude, longitude, altitude, audio_services, data_services)
515-
self.callback(evt_type, evt)
515+
self.callback(evt_type, evt, *self.callback_args)
516516

517-
def __init__(self, callback):
517+
def __init__(self, callback, callback_args=()):
518518
self._load_library()
519519
self.radio = ctypes.c_void_p()
520520
self.callback = callback
521+
self.callback_args = callback_args
521522

522523
@staticmethod
523524
def get_version():

0 commit comments

Comments
 (0)