Commit 2609572a authored by Philipp Hörist's avatar Philipp Hörist

Fix pylint errors

- logging-not-lazy
parent 3441e467
Pipeline #5418 passed with stages
in 39 seconds
......@@ -13,7 +13,7 @@ run-test:
- virtualenv -p python3 --system-site-packages civenv-nbxmpp
- . ./civenv-nbxmpp/bin/activate
- pip3 install -I pylint==2.4.4
- python3 -m pylint nbxmpp --disable=C0103,C0201,C0301,C0325,C0326,C0330,W0201,W0212,W0221,W0231,W0233,W0401,W0601,W0614,W0621,W0622,W1201,R0201,E1101,E1135
- python3 -m pylint nbxmpp --disable=C0103,C0201,C0301,C0325,C0326,C0330,W0201,W0212,W0221,W0231,W0233,W0401,W0601,W0614,W0621,W0622,R0201,E1101,E1135
- deactivate
- rm -rf civenv-nbxmpp
......
......@@ -281,7 +281,7 @@ class IdleQueue:
"""
Remove the read timeout
"""
log.debug('read timeout removed for fd %s' % fd)
log.debug('read timeout removed for fd %s', fd)
if fd in self.read_timeouts:
if timeout:
if timeout in self.read_timeouts[fd]:
......@@ -323,10 +323,10 @@ class IdleQueue:
if timeout > current_time:
continue
if func:
log.debug('Calling %s for fd %s' % (func, fd))
log.debug('Calling %s for fd %s', func, fd)
func()
else:
log.debug('Calling read_timeout for fd %s' % fd)
log.debug('Calling read_timeout for fd %s', fd)
self.queue[fd].read_timeout()
self.remove_timeout(fd, timeout)
......
......@@ -332,7 +332,7 @@ class XMPPDispatcher(PlugIn):
self._owner.Connection.disconnect()
return 0
except ValueError as e:
log.debug('ValueError: %s' % str(e))
log.debug('ValueError: %s', e)
self._owner.Connection.pollend()
return 0
if len(self._pendingExceptions) > 0:
......@@ -351,7 +351,7 @@ class XMPPDispatcher(PlugIn):
one namespace is already registered
(jabber:client or jabber:component:accept depending on context.
"""
log.debug('Registering namespace "%s"' % xmlns)
log.debug('Registering namespace "%s"', xmlns)
self.handlers[xmlns] = {}
self.RegisterProtocol('unknown', Protocol, xmlns=xmlns)
self.RegisterProtocol('default', Protocol, xmlns=xmlns)
......@@ -506,7 +506,7 @@ class XMPPDispatcher(PlugIn):
if self._eventHandler:
self._eventHandler(realm, event, data)
else:
log.warning('Received unhandled event: %s' % event)
log.warning('Received unhandled event: %s', event)
def dispatch(self, stanza):
"""
......
......@@ -42,7 +42,7 @@ class PlugIn:
code after plugging
"""
self._owner=owner
log.info('Plugging %s __INTO__ %s' % (self, self._owner))
log.info('Plugging %s __INTO__ %s', self, self._owner)
if self.__class__.__name__ in owner.__dict__:
log.debug('Plugging ignored: another instance already plugged.')
return None
......@@ -69,7 +69,7 @@ class PlugIn:
If defined by a subclass, call self.plugout() after unplugging to execute
hook code
"""
log.info('Plugging %s __OUT__ of %s.' % (self, self._owner))
log.info('Plugging %s __OUT__ of %s.', self, self._owner)
for method in self._exported_methods:
del self._owner.__dict__[method.__name__]
for method in self._old_owners_methods:
......
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