Remove trailing whitespaces.

This commit is contained in:
Emmanuel Gil Peyrot 2013-01-18 17:55:34 +01:00
commit 27b3592e16

View file

@ -58,9 +58,9 @@ class XEP_0095():
info(_("Plugin XEP_0095 initialization"))
self.host = host
self.si_profiles = {} #key: SI profile, value: callback
def getHandler(self, profile):
return XEP_0095_handler(self)
return XEP_0095_handler(self)
def registerSIProfile(self, si_profile, callback):
"""Add a callback for a SI Profile
@ -107,14 +107,14 @@ class XEP_0095():
@param to_jid: recipient
@param profile: %(doc_profile)s"""
self.sendError(iq_id, to_jid, 400, 'cancel', profile=profile)
def sendFailedError(self, iq_id, to_jid, profile):
"""Helper method to send when we transfer failed
@param iq_id: IQ id
@param to_jid: recipient
@param profile: %(doc_profile)s"""
self.sendError(iq_id, to_jid, 500, 'cancel', {'custom':'failed'}, profile=profile) #as there is no error code for failed transfer, we use 500 (undefined-condition)
def sendError(self, iq_id, to_jid, err_code, err_type='cancel', data={}, profile='@NONE@'):
"""Send IQ error as a result
@param iq_id: IQ id
@ -129,7 +129,7 @@ class XEP_0095():
result = domish.Element((None, 'iq'))
result['type'] = 'result'
result['id'] = iq_id
result['to'] = to_jid
result['to'] = to_jid
error_el = result.addElement('error')
error_el['err_code'] = str(err_code)
error_el['type'] = err_type
@ -162,7 +162,7 @@ class XEP_0095():
result = domish.Element((None, 'iq'))
result['type'] = 'result'
result['id'] = iq_id
result['to'] = to_jid
result['to'] = to_jid
si = result.addElement('si', NS_SI)
si.addChild(feature_elt)
for elt in misc_elts:
@ -182,9 +182,9 @@ class XEP_0095():
if not xmlstream:
error (_('Asking for an non-existant or not connected profile'))
return ""
offer = client.IQ(xmlstream,'set')
sid = str(uuid.uuid4())
sid = str(uuid.uuid4())
debug (_("Stream Session ID: %s") % offer["id"])
offer["from"] = current_jid.full()
@ -200,10 +200,10 @@ class XEP_0095():
offer.send()
return sid, offer
class XEP_0095_handler(XMPPHandler):
implements(iwokkel.IDisco)
def __init__(self, plugin_parent):
self.plugin_parent = plugin_parent
self.host = plugin_parent.host