def new_callback(event, widget): """ pychan will pass the callback event and widget keyword arguments if expected. We do not know if callback expected these, so we use tools.applyOnlySuitable - which is what pychan does. """ log(widget, event_name, group_name) return tools.applyOnlySuitable(callback, event=event, widget=widget)