Skip to content

Commit 93b410c

Browse files
committed
Rename error/info function helper; docstring update
1 parent d433e6e commit 93b410c

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎jack.py‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,19 +1662,25 @@ def set_error_function(callback=None):
16621662
16631663
Set it to ``None`` to restore the default error callback function
16641664
(which prints the error message plus a newline to stderr).
1665+
The `callback` function must have this signature::
1666+
1667+
callback(message:str) -> None
16651668
16661669
"""
1667-
_set_some_function(callback, _lib.jack_set_error_function)
1670+
_set_error_or_info_function(callback, _lib.jack_set_error_function)
16681671

16691672

16701673
def set_info_function(callback=None):
16711674
"""Set the callback for info message display.
16721675
16731676
Set it to ``None`` to restore default info callback function
16741677
(which prints the info message plus a newline to stderr).
1678+
The `callback` function must have this signature::
1679+
1680+
callback(message:str) -> None
16751681
16761682
"""
1677-
_set_some_function(callback, _lib.jack_set_info_function)
1683+
_set_error_or_info_function(callback, _lib.jack_set_info_function)
16781684

16791685

16801686
def client_pid(name):
@@ -1694,7 +1700,7 @@ def client_pid(name):
16941700
return _lib.jack_get_client_pid(name.encode())
16951701

16961702

1697-
def _set_some_function(callback, setter):
1703+
def _set_error_or_info_function(callback, setter):
16981704
"""Helper for set_error_function() and set_info_function()."""
16991705
if callback is None:
17001706
callback_wrapper = _ffi.NULL

0 commit comments

Comments
 (0)