Commit 8d4e815f authored by Yann Leboulanger's avatar Yann Leboulanger

fix some pylint errors

parent e57817ad
......@@ -85,6 +85,10 @@ class ChangeStatusCommand(AdHocCommand):
commandnode = 'change-status'
commandname = _('Change status information')
def __init__(self, conn, jid, sessionid):
AdHocCommand.__init__(self, conn, jid, sessionid)
self.cb = self.first_step
@staticmethod
def isVisibleFor(samejid):
"""
......@@ -93,6 +97,9 @@ class ChangeStatusCommand(AdHocCommand):
return samejid
def execute(self, request):
return self.cb(request)
def first_step(self, request):
# first query...
response, cmd = self.buildResponse(request, defaultaction = 'execute',
actions = ['execute'])
......@@ -120,11 +127,11 @@ class ChangeStatusCommand(AdHocCommand):
self.connection.connection.send(response)
# for next invocation
self.execute = self.changestatus
self.cb = self.second_step
return True # keep the session
def changestatus(self, request):
def second_step(self, request):
# check if the data is correct
try:
form = dataforms.SimpleDataForm(extend = request.getTag('command').\
......@@ -184,6 +191,10 @@ class LeaveGroupchatsCommand(AdHocCommand):
commandnode = 'leave-groupchats'
commandname = _('Leave Groupchats')
def __init__(self, conn, jid, sessionid):
AdHocCommand.__init__(self, conn, jid, sessionid)
self.cb = self.first_step
@staticmethod
def isVisibleFor(samejid):
"""
......@@ -192,6 +203,9 @@ class LeaveGroupchatsCommand(AdHocCommand):
return samejid
def execute(self, request):
return self.cb(request)
def first_step(self, request):
# first query...
response, cmd = self.buildResponse(request, defaultaction = 'execute',
actions=['execute'])
......@@ -220,11 +234,11 @@ class LeaveGroupchatsCommand(AdHocCommand):
self.connection.connection.send(response)
# for next invocation
self.execute = self.leavegroupchats
self.cb = self.second_step
return True # keep the session
def leavegroupchats(self, request):
def second_step(self, request):
# check if the data is correct
try:
form = dataforms.SimpleDataForm(extend = request.getTag('command').\
......
......@@ -305,7 +305,7 @@ class Media(nbxmpp.Node):
for uri in value:
self.addChild(node=uri)
def fdel(self, value):
def fdel(self):
for element in self.getTags('uri'):
self.delChild(element)
......
......@@ -720,7 +720,7 @@ class ConnectionSocks5Bytestream(ConnectionBytestream):
if file_props.stopped:
self.remove_transfer(file_props)
else:
app.socks5queue.send_file(file_props, self.name)
app.socks5queue.send_file(file_props, self.name, 'server')
raise nbxmpp.NodeProcessed
proxy = None
......
......@@ -730,7 +730,7 @@ class Socks5(object):
try:
fd = self.get_fd()
except IOError:
self.disconnect(False)
self.disconnect()
self.file_props.error = -6 # file system error
return 0
fd.write(self.remaining_buff)
......@@ -751,7 +751,7 @@ class Socks5(object):
try:
fd = self.get_fd()
except IOError:
self.disconnect(False)
self.disconnect()
self.file_props.error = -6 # file system error
return 0
try:
......
......@@ -375,7 +375,7 @@ class P2PConnection(IdleObject, PlugIn):
self.ais = socket.getaddrinfo(address['host'], address['port'], socket.AF_UNSPEC,
socket.SOCK_STREAM)
except socket.gaierror as e:
log.info('Lookup failure for %s: %s[%s]', host, e[1],
log.info('Lookup failure for %s: %s[%s]', self.host, e[1],
repr(e[0]), exc_info=True)
if len(self.addresses_) > 0: return self.get_next_addrinfo()
else:
......
......@@ -2582,7 +2582,7 @@ class Interface:
win.hide()
return True
window.connect('delete_event', on_delete)
view.updateNamespace({'gajim': gajim})
view.updateNamespace({'gajim': app})
app.ipython_window = window
def run(self, application):
......
......@@ -568,7 +568,7 @@ class PluginManager(metaclass=Singleton):
for option in fields:
if conf.get('info', option) is '':
raise configparser.NoOptionError('field empty')
raise configparser.NoOptionError(option, 'info')
if option == 'description':
setattr(module_attr, option, _(conf.get('info', option)))
continue
......
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