Commit efd417bf authored by Philipp Hörist's avatar Philipp Hörist

Use consistent callback signature for callbacks

parent c328063f
Pipeline #4868 passed with stages
in 29 seconds
......@@ -89,7 +89,7 @@ class NonBlockingBind(PlugIn):
self._owner.Dispatcher.SendAndCallForResponse(node, func=self._on_bind)
def _on_bind(self, stanza):
def _on_bind(self, _client, stanza):
if isResultNode(stanza):
bind = stanza.getTag('bind')
if bind is not None:
......@@ -115,7 +115,7 @@ class NonBlockingBind(PlugIn):
self._owner.Dispatcher.Event(Realm.CONNECTING, Event.BIND_FAILED)
self.PlugOut()
def _on_session(self, stanza):
def _on_session(self, _client, stanza):
if isResultNode(stanza):
log.info('Successfully started session')
self._on_bind_successful()
......
......@@ -613,7 +613,7 @@ class XMPPDispatcher(PlugIn):
cb, args)
try:
if args is None:
cb(stanza)
cb(self, stanza)
else:
cb(self, stanza, **args)
except NodeProcessed:
......
......@@ -21,7 +21,7 @@ Different stuff that wasn't worth separating it into modules
from .protocol import NS_REGISTER, NS_PRIVACY, NS_DATA, Iq, isResultNode, Node
def _on_default_response(disp, iq, cb):
def _on_response(resp):
def _on_response(_client, resp):
if isResultNode(resp):
if cb:
cb(True)
......@@ -47,7 +47,7 @@ def getRegInfo(disp, host, info={}, sync=True):
for i in info.keys():
iq.setTagData(i, info[i])
if sync:
disp.SendAndCallForResponse(iq, lambda resp:
disp.SendAndCallForResponse(iq, lambda _client, resp:
_ReceivedRegInfo(disp.Dispatcher, resp, host))
else:
disp.SendAndCallForResponse(iq, _ReceivedRegInfo, {'agent': host })
......@@ -127,7 +127,7 @@ def getPrivacyLists(disp):
lists on success.
"""
iq = Iq('get', NS_PRIVACY)
def _on_response(resp):
def _on_response(_client, resp):
dict_ = {'lists': []}
if not isResultNode(resp):
disp.Event(NS_PRIVACY, PRIVACY_LISTS_RECEIVED, False)
......@@ -142,7 +142,7 @@ def getPrivacyLists(disp):
def getActiveAndDefaultPrivacyLists(disp):
iq = Iq('get', NS_PRIVACY)
def _on_response(resp):
def _on_response(_client, resp):
dict_ = {'active': '', 'default': ''}
if not isResultNode(resp):
disp.Event(NS_PRIVACY, PRIVACY_LISTS_ACTIVE_DEFAULT, False)
......@@ -160,7 +160,7 @@ def getPrivacyList(disp, listname):
Request specific privacy list listname. Returns list of XML nodes (rules)
taken from the server responce.
"""
def _on_response(resp):
def _on_response(_client, resp):
if not isResultNode(resp):
disp.Event(NS_PRIVACY, PRIVACY_LIST_RECEIVED, False)
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment