Fix redefined-argument-from-local pylint errors
This commit is contained in:
parent
c5ca89558d
commit
b9edcceb4c
|
@ -59,9 +59,9 @@ class StandardCommonCommands(CommandContainer):
|
||||||
|
|
||||||
return '\n\n'.join(text)
|
return '\n\n'.join(text)
|
||||||
elif all:
|
elif all:
|
||||||
for cmd in self.list_commands():
|
for cmd_ in self.list_commands():
|
||||||
names = ', '.join(cmd.names)
|
names = ', '.join(cmd_.names)
|
||||||
description = cmd.extract_description()
|
description = cmd_.extract_description()
|
||||||
|
|
||||||
self.echo("%s - %s" % (names, description))
|
self.echo("%s - %s" % (names, description))
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -809,11 +809,10 @@ class MetacontactManager():
|
||||||
if not tag:
|
if not tag:
|
||||||
return []
|
return []
|
||||||
answers = []
|
answers = []
|
||||||
for account in self._metacontacts_tags:
|
if tag in self._metacontacts_tags[account]:
|
||||||
if tag in self._metacontacts_tags[account]:
|
for data in self._metacontacts_tags[account][tag]:
|
||||||
for data in self._metacontacts_tags[account][tag]:
|
data['account'] = account
|
||||||
data['account'] = account
|
answers.append(data)
|
||||||
answers.append(data)
|
|
||||||
return answers
|
return answers
|
||||||
|
|
||||||
def _metacontact_key(self, data):
|
def _metacontact_key(self, data):
|
||||||
|
|
|
@ -38,8 +38,8 @@ class FilesProp:
|
||||||
def getFilePropByAccount(cls, account):
|
def getFilePropByAccount(cls, account):
|
||||||
# Returns a list of file_props in one account
|
# Returns a list of file_props in one account
|
||||||
file_props = []
|
file_props = []
|
||||||
for account, sid in cls._files_props:
|
for account_, sid in cls._files_props:
|
||||||
if account == account:
|
if account_ == account:
|
||||||
file_props.append(cls._files_props[account, sid])
|
file_props.append(cls._files_props[account, sid])
|
||||||
return file_props
|
return file_props
|
||||||
|
|
||||||
|
|
|
@ -337,14 +337,15 @@ class ChooseGPGKeyDialog:
|
||||||
|
|
||||||
|
|
||||||
class ChangeActivityDialog:
|
class ChangeActivityDialog:
|
||||||
PAGELIST = ['doing_chores', 'drinking', 'eating', 'exercising', 'grooming',
|
PAGELIST = [
|
||||||
'having_appointment', 'inactive', 'relaxing', 'talking', 'traveling',
|
'doing_chores', 'drinking', 'eating', 'exercising', 'grooming',
|
||||||
'working']
|
'having_appointment', 'inactive', 'relaxing', 'talking', 'traveling',
|
||||||
|
'working']
|
||||||
|
|
||||||
def __init__(self, on_response, activity=None, subactivity=None, text=''):
|
def __init__(self, on_response, activity_=None, subactivity_=None, text=''):
|
||||||
self.on_response = on_response
|
self.on_response = on_response
|
||||||
self.activity = activity
|
self.activity = activity_
|
||||||
self.subactivity = subactivity
|
self.subactivity = subactivity_
|
||||||
self.text = text
|
self.text = text
|
||||||
self.xml = gtkgui_helpers.get_gtk_builder('change_activity_dialog.ui')
|
self.xml = gtkgui_helpers.get_gtk_builder('change_activity_dialog.ui')
|
||||||
self.window = self.xml.get_object('change_activity_dialog')
|
self.window = self.xml.get_object('change_activity_dialog')
|
||||||
|
@ -360,7 +361,7 @@ class ChangeActivityDialog:
|
||||||
for category in ACTIVITIES:
|
for category in ACTIVITIES:
|
||||||
item = self.xml.get_object(category + '_image')
|
item = self.xml.get_object(category + '_image')
|
||||||
item.set_from_pixbuf(
|
item.set_from_pixbuf(
|
||||||
gtkgui_helpers.load_activity_icon(category).get_pixbuf())
|
gtkgui_helpers.load_activity_icon(category).get_pixbuf())
|
||||||
item.set_tooltip_text(ACTIVITIES[category]['category'])
|
item.set_tooltip_text(ACTIVITIES[category]['category'])
|
||||||
|
|
||||||
vbox = self.xml.get_object(category + '_vbox')
|
vbox = self.xml.get_object(category + '_vbox')
|
||||||
|
@ -375,21 +376,19 @@ class ChangeActivityDialog:
|
||||||
else:
|
else:
|
||||||
rbtns[act] = group = Gtk.RadioButton()
|
rbtns[act] = group = Gtk.RadioButton()
|
||||||
|
|
||||||
|
icon = gtkgui_helpers.load_activity_icon(category, self.activity)
|
||||||
hbox = Gtk.HBox(homogeneous=False, spacing=5)
|
hbox = Gtk.HBox(homogeneous=False, spacing=5)
|
||||||
hbox.pack_start(gtkgui_helpers.load_activity_icon(category,
|
hbox.pack_start(icon, False, False, 0)
|
||||||
activity), False, False, 0)
|
lbl = Gtk.Label(
|
||||||
lbl = Gtk.Label(label='<b>' + ACTIVITIES[category]['category'] \
|
label='<b>%s</b>' % ACTIVITIES[category]['category'])
|
||||||
+ '</b>')
|
|
||||||
lbl.set_use_markup(True)
|
lbl.set_use_markup(True)
|
||||||
hbox.pack_start(lbl, False, False, 0)
|
hbox.pack_start(lbl, False, False, 0)
|
||||||
rbtns[act].add(hbox)
|
rbtns[act].add(hbox)
|
||||||
rbtns[act].connect('toggled', self.on_rbtn_toggled,
|
rbtns[act].connect(
|
||||||
[category, 'other'])
|
'toggled', self.on_rbtn_toggled, [category, 'other'])
|
||||||
vbox.pack_start(rbtns[act], False, False, 0)
|
vbox.pack_start(rbtns[act], False, False, 0)
|
||||||
|
|
||||||
activities = []
|
activities = list(ACTIVITIES[category].keys())
|
||||||
for activity in ACTIVITIES[category]:
|
|
||||||
activities.append(activity)
|
|
||||||
activities.sort()
|
activities.sort()
|
||||||
for activity in activities:
|
for activity in activities:
|
||||||
if activity == 'category':
|
if activity == 'category':
|
||||||
|
@ -403,13 +402,13 @@ class ChangeActivityDialog:
|
||||||
else:
|
else:
|
||||||
rbtns[act] = group = Gtk.RadioButton()
|
rbtns[act] = group = Gtk.RadioButton()
|
||||||
|
|
||||||
|
icon = gtkgui_helpers.load_activity_icon(category, activity)
|
||||||
|
label = Gtk.Label(label=ACTIVITIES[category][activity])
|
||||||
hbox = Gtk.HBox(homogeneous=False, spacing=5)
|
hbox = Gtk.HBox(homogeneous=False, spacing=5)
|
||||||
hbox.pack_start(gtkgui_helpers.load_activity_icon(category,
|
hbox.pack_start(icon, False, False, 0)
|
||||||
activity), False, False, 0)
|
hbox.pack_start(label, False, False, 0)
|
||||||
hbox.pack_start(Gtk.Label(label=ACTIVITIES[category][activity]),
|
rbtns[act].connect(
|
||||||
False, False, 0)
|
'toggled', self.on_rbtn_toggled, [category, activity])
|
||||||
rbtns[act].connect('toggled', self.on_rbtn_toggled,
|
|
||||||
[category, activity])
|
|
||||||
rbtns[act].add(hbox)
|
rbtns[act].add(hbox)
|
||||||
vbox.pack_start(rbtns[act], False, False, 0)
|
vbox.pack_start(rbtns[act], False, False, 0)
|
||||||
|
|
||||||
|
@ -427,8 +426,7 @@ class ChangeActivityDialog:
|
||||||
self.entry.set_sensitive(True)
|
self.entry.set_sensitive(True)
|
||||||
|
|
||||||
self.notebook.set_current_page(
|
self.notebook.set_current_page(
|
||||||
self.PAGELIST.index(self.activity))
|
self.PAGELIST.index(self.activity))
|
||||||
|
|
||||||
self.entry.set_text(text)
|
self.entry.set_text(text)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -454,8 +452,8 @@ class ChangeActivityDialog:
|
||||||
Return activity and messsage (None if no activity selected)
|
Return activity and messsage (None if no activity selected)
|
||||||
"""
|
"""
|
||||||
if self.checkbutton.get_active():
|
if self.checkbutton.get_active():
|
||||||
self.on_response(self.activity, self.subactivity,
|
self.on_response(
|
||||||
self.entry.get_text())
|
self.activity, self.subactivity, self.entry.get_text())
|
||||||
else:
|
else:
|
||||||
self.on_response(None, None, '')
|
self.on_response(None, None, '')
|
||||||
self.window.destroy()
|
self.window.destroy()
|
||||||
|
@ -466,9 +464,9 @@ class ChangeActivityDialog:
|
||||||
class ChangeMoodDialog:
|
class ChangeMoodDialog:
|
||||||
COLS = 11
|
COLS = 11
|
||||||
|
|
||||||
def __init__(self, on_response, mood=None, text=''):
|
def __init__(self, on_response, mood_=None, text=''):
|
||||||
self.on_response = on_response
|
self.on_response = on_response
|
||||||
self.mood = mood
|
self.mood = mood_
|
||||||
self.text = text
|
self.text = text
|
||||||
self.xml = gtkgui_helpers.get_gtk_builder('change_mood_dialog.ui')
|
self.xml = gtkgui_helpers.get_gtk_builder('change_mood_dialog.ui')
|
||||||
|
|
||||||
|
@ -1418,18 +1416,18 @@ class TransformChatToMUC:
|
||||||
# transports, zeroconf contacts, minimized groupchats
|
# transports, zeroconf contacts, minimized groupchats
|
||||||
def invitable(contact, contact_transport=None):
|
def invitable(contact, contact_transport=None):
|
||||||
return (contact.jid not in self.auto_jids and
|
return (contact.jid not in self.auto_jids and
|
||||||
contact.jid != app.get_jid_from_account(self.account) and
|
contact.jid != app.get_jid_from_account(account) and
|
||||||
contact.jid not in app.interface.minimized_controls[account] and
|
contact.jid not in app.interface.minimized_controls[account] and
|
||||||
not contact.is_transport() and
|
not contact.is_transport() and
|
||||||
contact_transport in ('jabber', None))
|
contact_transport in ('jabber', None))
|
||||||
|
|
||||||
# set jabber id and pseudos
|
# set jabber id and pseudos
|
||||||
for account in app.contacts.get_accounts():
|
for account_ in app.contacts.get_accounts():
|
||||||
if app.connections[account].is_zeroconf:
|
if app.connections[account_].is_zeroconf:
|
||||||
continue
|
continue
|
||||||
for jid in app.contacts.get_jid_list(account):
|
for jid in app.contacts.get_jid_list(account_):
|
||||||
contact = app.contacts.get_contact_with_highest_priority(
|
contact = app.contacts.get_contact_with_highest_priority(
|
||||||
account, jid)
|
account_, jid)
|
||||||
contact_transport = app.get_transport_name_from_jid(jid)
|
contact_transport = app.get_transport_name_from_jid(jid)
|
||||||
# Add contact if it can be invited
|
# Add contact if it can be invited
|
||||||
if invitable(contact, contact_transport) and \
|
if invitable(contact, contact_transport) and \
|
||||||
|
|
|
@ -126,7 +126,7 @@ class Section(Gtk.Box):
|
||||||
else:
|
else:
|
||||||
# We dont have a image for the base codepoint
|
# We dont have a image for the base codepoint
|
||||||
# so skip all modifiers of it
|
# so skip all modifiers of it
|
||||||
for codepoint, attrs in variations.items():
|
for _entry in variations:
|
||||||
pixbuf = self._get_next_pixbuf()
|
pixbuf = self._get_next_pixbuf()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
@ -438,12 +438,12 @@ class GajimRemote(Server):
|
||||||
contact = app.contacts.get_contact_with_highest_priority(
|
contact = app.contacts.get_contact_with_highest_priority(
|
||||||
account, jid)
|
account, jid)
|
||||||
else:
|
else:
|
||||||
for account in accounts:
|
for account_ in accounts:
|
||||||
contact = app.contacts.get_contact_with_highest_priority(
|
contact = app.contacts.get_contact_with_highest_priority(
|
||||||
account, jid)
|
account, jid)
|
||||||
if contact and app.connections[account].connected > 1:
|
if contact and app.connections[account_].connected > 1:
|
||||||
# account is connected
|
# account is connected
|
||||||
connected_account = account
|
connected_account = account_
|
||||||
break
|
break
|
||||||
if not contact:
|
if not contact:
|
||||||
contact = jid
|
contact = jid
|
||||||
|
@ -468,12 +468,12 @@ class GajimRemote(Server):
|
||||||
# account and groupchat are connected
|
# account and groupchat are connected
|
||||||
connected_account = account
|
connected_account = account
|
||||||
else:
|
else:
|
||||||
for account in accounts:
|
for account_ in accounts:
|
||||||
if app.connections[account].connected > 1 and \
|
if app.connections[account_].connected > 1 and \
|
||||||
room_jid in app.gc_connected[account] and \
|
room_jid in app.gc_connected[account_] and \
|
||||||
app.gc_connected[account][room_jid]:
|
app.gc_connected[account_][room_jid]:
|
||||||
# account and groupchat are connected
|
# account and groupchat are connected
|
||||||
connected_account = account
|
connected_account = account_
|
||||||
break
|
break
|
||||||
return connected_account
|
return connected_account
|
||||||
|
|
||||||
|
@ -813,13 +813,13 @@ class GajimRemote(Server):
|
||||||
if account:
|
if account:
|
||||||
accounts = [account]
|
accounts = [account]
|
||||||
contact_exists = False
|
contact_exists = False
|
||||||
for account in accounts:
|
for account_ in accounts:
|
||||||
contacts = app.contacts.get_contacts(account, jid)
|
contacts = app.contacts.get_contacts(account_, jid)
|
||||||
if contacts:
|
if contacts:
|
||||||
app.connections[account].get_module('Presence').unsubscribe(jid)
|
app.connections[account_].get_module('Presence').unsubscribe(jid)
|
||||||
for contact in contacts:
|
for contact in contacts:
|
||||||
app.interface.roster.remove_contact(contact, account)
|
app.interface.roster.remove_contact(contact, account_)
|
||||||
app.contacts.remove_jid(account, jid)
|
app.contacts.remove_jid(account_, jid)
|
||||||
contact_exists = True
|
contact_exists = True
|
||||||
return contact_exists
|
return contact_exists
|
||||||
|
|
||||||
|
@ -841,14 +841,14 @@ class GajimRemote(Server):
|
||||||
if jid.startswith('xmpp:'):
|
if jid.startswith('xmpp:'):
|
||||||
return jid[5:] # len('xmpp:') = 5
|
return jid[5:] # len('xmpp:') = 5
|
||||||
nick_in_roster = None # Is jid a nick ?
|
nick_in_roster = None # Is jid a nick ?
|
||||||
for account in accounts:
|
for account_ in accounts:
|
||||||
# Does jid exists in roster of one account ?
|
# Does jid exists in roster of one account ?
|
||||||
if app.contacts.get_contacts(account, jid):
|
if app.contacts.get_contacts(account_, jid):
|
||||||
return jid
|
return jid
|
||||||
if not nick_in_roster:
|
if not nick_in_roster:
|
||||||
# look in all contact if one has jid as nick
|
# look in all contact if one has jid as nick
|
||||||
for jid_ in app.contacts.get_jid_list(account):
|
for jid_ in app.contacts.get_jid_list(account_):
|
||||||
c = app.contacts.get_contacts(account, jid_)
|
c = app.contacts.get_contacts(account_, jid_)
|
||||||
if c[0].name == jid:
|
if c[0].name == jid:
|
||||||
nick_in_roster = jid_
|
nick_in_roster = jid_
|
||||||
break
|
break
|
||||||
|
|
|
@ -3842,7 +3842,7 @@ class RosterWindow:
|
||||||
self._toggeling_row = True
|
self._toggeling_row = True
|
||||||
model = widget.get_model()
|
model = widget.get_model()
|
||||||
child_model = model.get_model()
|
child_model = model.get_model()
|
||||||
child_iter = model.convert_iter_to_child_iter(titer)
|
child_iter = model.convert_iter_to_child_iter(titer)
|
||||||
|
|
||||||
if self.regroup: # merged accounts
|
if self.regroup: # merged accounts
|
||||||
accounts = list(app.connections.keys())
|
accounts = list(app.connections.keys())
|
||||||
|
@ -3867,8 +3867,8 @@ class RosterWindow:
|
||||||
app.contacts.is_big_brother(account, jid, accounts) and \
|
app.contacts.is_big_brother(account, jid, accounts) and \
|
||||||
account + group + jid not in self.collapsed_rows:
|
account + group + jid not in self.collapsed_rows:
|
||||||
titers = self._get_contact_iter(jid, account)
|
titers = self._get_contact_iter(jid, account)
|
||||||
for titer in titers:
|
for titer_ in titers:
|
||||||
path = model.get_path(titer)
|
path = model.get_path(titer_)
|
||||||
self.tree.expand_row(path, False)
|
self.tree.expand_row(path, False)
|
||||||
elif type_ == 'account':
|
elif type_ == 'account':
|
||||||
account = list(accounts)[0] # There is only one cause we don't use merge
|
account = list(accounts)[0] # There is only one cause we don't use merge
|
||||||
|
|
Loading…
Reference in New Issue