changeset 1196b6ac3d82 in /home/hg/repos/python-nbxmpp
details:http://hg.gajim.org/python-nbxmpp?cmd=changeset;node=1196b6ac3d82 description: Replace the obsolete method warn.
http://docs.python.org/3/library/logging.html
Note: There is an obsolete method warn which is functionally identical to warning. As warn is deprecated, please do not use it - use warning instead.
diffstat:
nbxmpp/auth_nb.py | 2 +- nbxmpp/bosh.py | 6 +++--- nbxmpp/dispatcher_nb.py | 4 ++-- nbxmpp/transports_nb.py | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-)
diffs (107 lines):
diff -r 8bd30c2236ef -r 1196b6ac3d82 nbxmpp/auth_nb.py --- a/nbxmpp/auth_nb.py Tue Jan 21 00:15:25 2014 +0100 +++ b/nbxmpp/auth_nb.py Tue Feb 18 09:27:16 2014 +0100 @@ -582,7 +582,7 @@ query.setTagData('hash', hash_) self._method='0k' else: - log.warn("Secure methods unsupported, performing plain text \ + log.warning("Secure methods unsupported, performing plain text \ authentication") self._method = 'plain' self._owner._caller.get_password(self._on_password, self._method) diff -r 8bd30c2236ef -r 1196b6ac3d82 nbxmpp/bosh.py --- a/nbxmpp/bosh.py Tue Jan 21 00:15:25 2014 +0100 +++ b/nbxmpp/bosh.py Tue Feb 18 09:27:16 2014 +0100 @@ -129,7 +129,7 @@ if self.get_state() != DISCONNECTED and self.fd != -1: NonBlockingTransport.set_timeout(self, timeout) else: - log.warn('set_timeout: TIMEOUT NOT SET: state is %s, fd is %s' % (self.get_state(), self.fd)) + log.warning('set_timeout: TIMEOUT NOT SET: state is %s, fd is %s' % (self.get_state(), self.fd))
def on_http_request_possible(self): """ @@ -216,7 +216,7 @@ # sent after HTTP response from CM, exception is when we're disconnecting - then we # send anyway if total_pending_reqs >= self.bosh_requests and self.get_state()!=DISCONNECTING: - log.warn('attemp to make more requests than allowed by Connection Manager:\n%s' % + log.warning('attemp to make more requests than allowed by Connection Manager:\n%s' % self.get_current_state()) return
@@ -309,7 +309,7 @@ :param socket: disconnected transport object """ if socket.http_persistent: - log.warn('Fallback to nonpersistent HTTP (no pipelining as well)') + log.warning('Fallback to nonpersistent HTTP (no pipelining as well)') socket.http_persistent = False self.http_persistent = False self.http_pipelining = False diff -r 8bd30c2236ef -r 1196b6ac3d82 nbxmpp/dispatcher_nb.py --- a/nbxmpp/dispatcher_nb.py Tue Jan 21 00:15:25 2014 +0100 +++ b/nbxmpp/dispatcher_nb.py Tue Feb 18 09:27:16 2014 +0100 @@ -428,12 +428,12 @@ # log.info('in dispatch, getting ns for %s, and the ns is %s' # % (stanza, xmlns)) if xmlns not in self.handlers: - log.warn("Unknown namespace: " + xmlns) + log.warning("Unknown namespace: " + xmlns) xmlns = 'unknown' # features stanza has been handled before if name not in self.handlers[xmlns]: if name != 'features': - log.warn("Unknown stanza: " + name) + log.warning("Unknown stanza: " + name) else: log.debug("Got %s/%s stanza" % (xmlns, name)) name='unknown' diff -r 8bd30c2236ef -r 1196b6ac3d82 nbxmpp/transports_nb.py --- a/nbxmpp/transports_nb.py Tue Jan 21 00:15:25 2014 +0100 +++ b/nbxmpp/transports_nb.py Tue Feb 18 09:27:16 2014 +0100 @@ -52,7 +52,7 @@ try: port = splitted.port except ValueError: - log.warn('port cannot be extracted from BOSH URL %s, using default port' \ + log.warning('port cannot be extracted from BOSH URL %s, using default port' \ % uri) port = '' if not port: @@ -224,7 +224,7 @@ if hasattr(self, '_owner') and hasattr(self._owner, 'Dispatcher'): self.on_receive = self._owner.Dispatcher.ProcessNonBlocking else: - log.warn('No Dispatcher plugged. Received data will not be processed') + log.warning('No Dispatcher plugged. Received data will not be processed') self.on_receive = None return self.on_receive = recv_handler @@ -482,14 +482,14 @@ if self.get_state() != DISCONNECTED and self.fd != -1: NonBlockingTransport.set_timeout(self, timeout) else: - log.warn('set_timeout: TIMEOUT NOT SET: state is %s, fd is %s' % + log.warning('set_timeout: TIMEOUT NOT SET: state is %s, fd is %s' % (self.get_state(), self.fd))
def remove_timeout(self): if self.fd: NonBlockingTransport.remove_timeout(self) else: - log.warn('remove_timeout: no self.fd state is %s' % self.get_state()) + log.warning('remove_timeout: no self.fd state is %s' % self.get_state())
def send(self, raw_data, now=False): """ @@ -542,7 +542,7 @@ """ if not self.sendbuff: if not self.sendqueue: - log.warn('calling send on empty buffer and queue') + log.warning('calling send on empty buffer and queue') self._plug_idle(writable=False, readable=True) return None self.sendbuff = self.sendqueue.pop(0)