Yann Leboulanger pushed to branch master at gajim / python-nbxmpp
Commits:
-
eb88300e
by Yann Leboulanger at 2016-11-02T22:31:45+01:00
6 changed files:
- nbxmpp/auth_nb.py
- nbxmpp/client_nb.py
- nbxmpp/dispatcher_nb.py
- nbxmpp/features_nb.py
- nbxmpp/smacks.py
- nbxmpp/tls_nb.py
Changes:
| ... | ... | @@ -663,7 +663,7 @@ class NonBlockingBind(PlugIn): |
| 663 | 663 |
self.resuming = False
|
| 664 | 664 |
|
| 665 | 665 |
def plugin(self, owner):
|
| 666 |
''' Start resource binding, if allowed at this time. Used internally. '''
|
|
| 666 |
""" Start resource binding, if allowed at this time. Used internally. """
|
|
| 667 | 667 |
if self._owner.Dispatcher.Stream.features:
|
| 668 | 668 |
try:
|
| 669 | 669 |
self.FeaturesHandler(self._owner.Dispatcher,
|
| ... | ... | @@ -160,6 +160,7 @@ class NonBlockingClient: |
| 160 | 160 |
:param port: port number of XMPP server
|
| 161 | 161 |
:param on_proxy_failure: called if error occurs during TCP connection
|
| 162 | 162 |
to proxy server or during proxy connecting process
|
| 163 |
:param on_stream_error_cb: called if error occurs
|
|
| 163 | 164 |
:param proxy: dictionary with proxy data. It should contain at least
|
| 164 | 165 |
values for keys 'host' and 'port' - connection details for proxy
|
| 165 | 166 |
serve and optionally keys 'user' and 'pass' as proxy credentials
|
| ... | ... | @@ -298,6 +298,7 @@ class XMPPDispatcher(PlugIn): |
| 298 | 298 |
:param typ: value of stanza's "type" attribute. If not specified any
|
| 299 | 299 |
value will match
|
| 300 | 300 |
:param ns: namespace of child that stanza must contain.
|
| 301 |
:param xmlns: xml namespace
|
|
| 301 | 302 |
:param makefirst: insert handler in the beginning of handlers list instead
|
| 302 | 303 |
of adding it to the end. Note that more common handlers i.e. w/o "typ"
|
| 303 | 304 |
and " will be called first nevertheless.
|
| ... | ... | @@ -213,6 +213,6 @@ def setPrivacyList(disp, listname, tags): |
| 213 | 213 |
_on_default_response(disp, iq, None)
|
| 214 | 214 |
|
| 215 | 215 |
def delPrivacyList(disp, listname, cb=None):
|
| 216 |
''' Deletes privacy list 'listname'. Returns true on success. '''
|
|
| 216 |
""" Deletes privacy list 'listname'. Returns true on success. """
|
|
| 217 | 217 |
iq = Iq('set', NS_PRIVACY, payload=[Node('list', {'name':listname})])
|
| 218 | 218 |
_on_default_response(disp, iq, cb)
|
| ... | ... | @@ -94,11 +94,11 @@ class Smacks(): |
| 94 | 94 |
self._owner.Connection.send(r, False)
|
| 95 | 95 |
|
| 96 | 96 |
def check_ack(self, disp, stanza):
|
| 97 |
'''
|
|
| 97 |
"""
|
|
| 98 | 98 |
Checks if the number of stanzas sent are the same as the
|
| 99 | 99 |
number of stanzas received by the server. Pops stanzas that were
|
| 100 | 100 |
handled by the server from the queue.
|
| 101 |
'''
|
|
| 101 |
"""
|
|
| 102 | 102 |
h = stanza.getAttr('h')
|
| 103 | 103 |
if not h:
|
| 104 | 104 |
log.error('Server did not send h attribute')
|
| ... | ... | @@ -118,11 +118,11 @@ class Smacks(): |
| 118 | 118 |
self.uqueue.pop(0)
|
| 119 | 119 |
|
| 120 | 120 |
def check_resume(self, disp, stanza):
|
| 121 |
'''
|
|
| 121 |
"""
|
|
| 122 | 122 |
Checks if the number of stanzas sent are the same as the
|
| 123 | 123 |
number of stanzas received by the server. Resends stanzas not received
|
| 124 | 124 |
by the server in the last session.
|
| 125 |
'''
|
|
| 125 |
"""
|
|
| 126 | 126 |
h = stanza.getAttr('h')
|
| 127 | 127 |
if not h:
|
| 128 | 128 |
log.error('Server did not send h attribute')
|
| ... | ... | @@ -158,7 +158,7 @@ class PyOpenSSLWrapper(SSLWrapper): |
| 158 | 158 |
self.parent.__init__(self, *args)
|
| 159 | 159 |
|
| 160 | 160 |
def is_numtoolarge(self, e):
|
| 161 |
''' Magic methods don't need documentation '''
|
|
| 161 |
""" Magic methods don't need documentation """
|
|
| 162 | 162 |
t = ('asn1 encoding routines', 'a2d_ASN1_OBJECT', 'first num too large')
|
| 163 | 163 |
return (isinstance(e.args, (list, tuple)) and len(e.args) == 1 and
|
| 164 | 164 |
isinstance(e.args[0], (list, tuple)) and len(e.args[0]) == 2 and
|