Fix redefined-builtin pylint errors
This commit is contained in:
parent
f12dfb811d
commit
c156f02cc0
|
@ -89,8 +89,8 @@ class ChatCommandProcessor(CommandProcessor):
|
||||||
# the /help command. Don't forget to pass self, as all commands
|
# the /help command. Don't forget to pass self, as all commands
|
||||||
# are unbound. And also don't forget to print output.
|
# are unbound. And also don't forget to print output.
|
||||||
if 'h' in kwargs or 'help' in kwargs:
|
if 'h' in kwargs or 'help' in kwargs:
|
||||||
help = self.get_command('help')
|
help_ = self.get_command('help')
|
||||||
self.echo(help(self, name))
|
self.echo(help_(self, name))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def command_postprocessor(self, command, name, arguments, args, kwargs, value):
|
def command_postprocessor(self, command, name, arguments, args, kwargs, value):
|
||||||
|
@ -111,29 +111,29 @@ class CommandTools:
|
||||||
self.install_tags()
|
self.install_tags()
|
||||||
|
|
||||||
def install_tags(self):
|
def install_tags(self):
|
||||||
buffer = self.conv_textview.tv.get_buffer()
|
buffer_ = self.conv_textview.tv.get_buffer()
|
||||||
|
|
||||||
name = "Monospace"
|
name = "Monospace"
|
||||||
font = Pango.FontDescription(name)
|
font = Pango.FontDescription(name)
|
||||||
|
|
||||||
command_ok_tag = buffer.create_tag("command_ok")
|
command_ok_tag = buffer_.create_tag("command_ok")
|
||||||
command_ok_tag.set_property("font-desc", font)
|
command_ok_tag.set_property("font-desc", font)
|
||||||
command_ok_tag.set_property("foreground", "#3465A4")
|
command_ok_tag.set_property("foreground", "#3465A4")
|
||||||
|
|
||||||
command_error_tag = buffer.create_tag("command_error")
|
command_error_tag = buffer_.create_tag("command_error")
|
||||||
command_error_tag.set_property("font-desc", font)
|
command_error_tag.set_property("font-desc", font)
|
||||||
command_error_tag.set_property("foreground", "#F57900")
|
command_error_tag.set_property("foreground", "#F57900")
|
||||||
|
|
||||||
def shift_line(self):
|
def shift_line(self):
|
||||||
buffer = self.conv_textview.tv.get_buffer()
|
buffer_ = self.conv_textview.tv.get_buffer()
|
||||||
iter = buffer.get_end_iter()
|
iter_ = buffer_.get_end_iter()
|
||||||
if iter.ends_line() and not iter.is_start():
|
if iter_.ends_line() and not iter_.is_start():
|
||||||
buffer.insert_with_tags_by_name(iter, "\n", "eol")
|
buffer_.insert_with_tags_by_name(iter_, "\n", "eol")
|
||||||
|
|
||||||
def append_with_tags(self, text, *tags):
|
def append_with_tags(self, text, *tags):
|
||||||
buffer = self.conv_textview.tv.get_buffer()
|
buffer_ = self.conv_textview.tv.get_buffer()
|
||||||
iter = buffer.get_end_iter()
|
iter_ = buffer_.get_end_iter()
|
||||||
buffer.insert_with_tags_by_name(iter, text, *tags)
|
buffer_.insert_with_tags_by_name(iter_, text, *tags)
|
||||||
|
|
||||||
def echo(self, text, tag="command_ok"):
|
def echo(self, text, tag="command_ok"):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -66,8 +66,8 @@ class StandardCommonCommands(CommandContainer):
|
||||||
|
|
||||||
self.echo("%s - %s" % (names, description))
|
self.echo("%s - %s" % (names, description))
|
||||||
else:
|
else:
|
||||||
help = self.get_command('help')
|
help_ = self.get_command('help')
|
||||||
self.echo(help(self, 'help'))
|
self.echo(help_(self, 'help'))
|
||||||
|
|
||||||
@command(raw=True)
|
@command(raw=True)
|
||||||
@doc(_("Send a message to the contact"))
|
@doc(_("Send a message to the contact"))
|
||||||
|
|
|
@ -415,8 +415,8 @@ class CapsCache:
|
||||||
|
|
||||||
def forget_caps(self, client_caps):
|
def forget_caps(self, client_caps):
|
||||||
hash_method = client_caps._hash_method
|
hash_method = client_caps._hash_method
|
||||||
hash = client_caps._hash
|
hash_ = client_caps._hash
|
||||||
key = (hash_method, hash)
|
key = (hash_method, hash_)
|
||||||
if key in self.__cache:
|
if key in self.__cache:
|
||||||
del self.__cache[key]
|
del self.__cache[key]
|
||||||
|
|
||||||
|
|
|
@ -503,8 +503,8 @@ def sanitize_filename(filename):
|
||||||
"""
|
"""
|
||||||
# 48 is the limit
|
# 48 is the limit
|
||||||
if len(filename) > 48:
|
if len(filename) > 48:
|
||||||
hash = hashlib.md5(filename.encode('utf-8'))
|
hash_ = hashlib.md5(filename.encode('utf-8'))
|
||||||
filename = base64.b64encode(hash.digest()).decode('utf-8')
|
filename = base64.b64encode(hash_.digest()).decode('utf-8')
|
||||||
|
|
||||||
# make it latin chars only
|
# make it latin chars only
|
||||||
filename = punycode_encode(filename).decode('utf-8')
|
filename = punycode_encode(filename).decode('utf-8')
|
||||||
|
@ -729,7 +729,7 @@ def check_soundfile_path(file_, dirs=None):
|
||||||
return d
|
return d
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def strip_soundfile_path(file_, dirs=None, abs=True):
|
def strip_soundfile_path(file_, dirs=None, abs_=True):
|
||||||
"""
|
"""
|
||||||
Remove knowns paths from a sound file
|
Remove knowns paths from a sound file
|
||||||
|
|
||||||
|
@ -737,7 +737,7 @@ def strip_soundfile_path(file_, dirs=None, abs=True):
|
||||||
So config have no hardcoded path to DATA_DIR and text in textfield is shorther.
|
So config have no hardcoded path to DATA_DIR and text in textfield is shorther.
|
||||||
param: file_: the filename to strip.
|
param: file_: the filename to strip.
|
||||||
param: dirs: list of knowns paths from which the filename should be stripped.
|
param: dirs: list of knowns paths from which the filename should be stripped.
|
||||||
param: abs: force absolute path on dirs
|
param: abs_: force absolute path on dirs
|
||||||
"""
|
"""
|
||||||
if not file_:
|
if not file_:
|
||||||
return None
|
return None
|
||||||
|
@ -749,7 +749,7 @@ def strip_soundfile_path(file_, dirs=None, abs=True):
|
||||||
name = os.path.basename(file_)
|
name = os.path.basename(file_)
|
||||||
for d in dirs:
|
for d in dirs:
|
||||||
d = os.path.join(d, 'sounds', name)
|
d = os.path.join(d, 'sounds', name)
|
||||||
if abs:
|
if abs_:
|
||||||
d = os.path.abspath(d)
|
d = os.path.abspath(d)
|
||||||
if file_ == d:
|
if file_ == d:
|
||||||
return name
|
return name
|
||||||
|
|
|
@ -331,12 +331,12 @@ class SocksQueue:
|
||||||
result = sender.send_file()
|
result = sender.send_file()
|
||||||
self.process_result(result, sender)
|
self.process_result(result, sender)
|
||||||
|
|
||||||
def isHashInSockObjs(self, sockobjs, hash):
|
def isHashInSockObjs(self, sockobjs, hash_):
|
||||||
'''
|
'''
|
||||||
It tells wether there is a particular hash in sockobjs or not
|
It tells wether there is a particular hash in sockobjs or not
|
||||||
'''
|
'''
|
||||||
for key in sockobjs:
|
for key in sockobjs:
|
||||||
if hash in key:
|
if hash_ in key:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
@ -429,8 +429,8 @@ class SingleForm(Gtk.Table):
|
||||||
else:
|
else:
|
||||||
# more than 5 options: show combobox
|
# more than 5 options: show combobox
|
||||||
def on_list_multi_treeview_changed(selection, f):
|
def on_list_multi_treeview_changed(selection, f):
|
||||||
def for_selected(treemodel, path, iter):
|
def for_selected(treemodel, path, iter_):
|
||||||
vals.append(treemodel[iter][1])
|
vals.append(treemodel[iter_][1])
|
||||||
vals = []
|
vals = []
|
||||||
selection.selected_foreach(for_selected)
|
selection.selected_foreach(for_selected)
|
||||||
field.values = vals[:]
|
field.values = vals[:]
|
||||||
|
|
|
@ -1989,9 +1989,9 @@ class DiscussionGroupsBrowser(AgentBrowser):
|
||||||
def _get_iter(self, node):
|
def _get_iter(self, node):
|
||||||
''' Look for an iter with the given node '''
|
''' Look for an iter with the given node '''
|
||||||
self.found_iter = None
|
self.found_iter = None
|
||||||
def is_node(model, path, iter, node):
|
def is_node(model, path, iter_, node):
|
||||||
if model[iter][1] == node:
|
if model[iter_][1] == node:
|
||||||
self.found_iter = iter
|
self.found_iter = iter_
|
||||||
return True
|
return True
|
||||||
self.model.foreach(is_node, node)
|
self.model.foreach(is_node, node)
|
||||||
return self.found_iter
|
return self.found_iter
|
||||||
|
|
|
@ -180,12 +180,12 @@ class Preferences(Gtk.ApplicationWindow):
|
||||||
self.iconset_combobox.add_attribute(renderer_image, 'image', 0)
|
self.iconset_combobox.add_attribute(renderer_image, 'image', 0)
|
||||||
self.iconset_combobox.set_model(model)
|
self.iconset_combobox.set_model(model)
|
||||||
l = []
|
l = []
|
||||||
for dir in iconsets_list:
|
for dir_ in iconsets_list:
|
||||||
if not os.path.isdir(os.path.join(configpaths.get('DATA'), 'iconsets', dir)) \
|
if not os.path.isdir(os.path.join(configpaths.get('DATA'), 'iconsets', dir_)) \
|
||||||
and not os.path.isdir(os.path.join(configpaths.get('MY_ICONSETS'), dir)):
|
and not os.path.isdir(os.path.join(configpaths.get('MY_ICONSETS'), dir_)):
|
||||||
continue
|
continue
|
||||||
if dir != '.svn' and dir != 'transports':
|
if dir_ not in ('.svn', 'transports'):
|
||||||
l.append(dir)
|
l.append(dir_)
|
||||||
if l.count == 0:
|
if l.count == 0:
|
||||||
l.append(' ')
|
l.append(' ')
|
||||||
for i in range(len(l)):
|
for i in range(len(l)):
|
||||||
|
|
|
@ -555,9 +555,9 @@ def create_list_multi(value_list, selected_values=None):
|
||||||
col.pack_start(cell, True)
|
col.pack_start(cell, True)
|
||||||
col.set_attributes(cell, text=0)
|
col.set_attributes(cell, text=0)
|
||||||
for value in value_list:
|
for value in value_list:
|
||||||
iter = liststore.append(value)
|
iter_ = liststore.append(value)
|
||||||
if value[1] in selected_values:
|
if value[1] in selected_values:
|
||||||
treeview.get_selection().select_iter(iter)
|
treeview.get_selection().select_iter(iter_)
|
||||||
treeview.show_all()
|
treeview.show_all()
|
||||||
return treeview
|
return treeview
|
||||||
|
|
||||||
|
|
|
@ -122,9 +122,9 @@ class PluginsWindow:
|
||||||
|
|
||||||
@log_calls('PluginsWindow')
|
@log_calls('PluginsWindow')
|
||||||
def installed_plugins_treeview_selection_changed(self, treeview_selection):
|
def installed_plugins_treeview_selection_changed(self, treeview_selection):
|
||||||
model, iter = treeview_selection.get_selected()
|
model, iter_ = treeview_selection.get_selected()
|
||||||
if iter:
|
if iter_:
|
||||||
plugin = model.get_value(iter, Column.PLUGIN)
|
plugin = model.get_value(iter_, Column.PLUGIN)
|
||||||
self._display_installed_plugin_info(plugin)
|
self._display_installed_plugin_info(plugin)
|
||||||
else:
|
else:
|
||||||
self._clear_installed_plugin_info()
|
self._clear_installed_plugin_info()
|
||||||
|
@ -207,9 +207,9 @@ class PluginsWindow:
|
||||||
@log_calls('PluginsWindow')
|
@log_calls('PluginsWindow')
|
||||||
def on_configure_plugin_button_clicked(self, widget):
|
def on_configure_plugin_button_clicked(self, widget):
|
||||||
selection = self.installed_plugins_treeview.get_selection()
|
selection = self.installed_plugins_treeview.get_selection()
|
||||||
model, iter = selection.get_selected()
|
model, iter_ = selection.get_selected()
|
||||||
if iter:
|
if iter_:
|
||||||
plugin = model.get_value(iter, Column.PLUGIN)
|
plugin = model.get_value(iter_, Column.PLUGIN)
|
||||||
|
|
||||||
if isinstance(plugin.config_dialog, GajimPluginConfigDialog):
|
if isinstance(plugin.config_dialog, GajimPluginConfigDialog):
|
||||||
plugin.config_dialog.run(self.window)
|
plugin.config_dialog.run(self.window)
|
||||||
|
@ -225,16 +225,16 @@ class PluginsWindow:
|
||||||
@log_calls('PluginsWindow')
|
@log_calls('PluginsWindow')
|
||||||
def on_uninstall_plugin_button_clicked(self, widget):
|
def on_uninstall_plugin_button_clicked(self, widget):
|
||||||
selection = self.installed_plugins_treeview.get_selection()
|
selection = self.installed_plugins_treeview.get_selection()
|
||||||
model, iter = selection.get_selected()
|
model, iter_ = selection.get_selected()
|
||||||
if iter:
|
if iter_:
|
||||||
plugin = model.get_value(iter, Column.PLUGIN)
|
plugin = model.get_value(iter_, Column.PLUGIN)
|
||||||
try:
|
try:
|
||||||
app.plugin_manager.uninstall_plugin(plugin)
|
app.plugin_manager.uninstall_plugin(plugin)
|
||||||
except PluginsystemError as e:
|
except PluginsystemError as e:
|
||||||
WarningDialog(_('Unable to properly remove the plugin'),
|
WarningDialog(_('Unable to properly remove the plugin'),
|
||||||
str(e), self.window)
|
str(e), self.window)
|
||||||
return
|
return
|
||||||
model.remove(iter)
|
model.remove(iter_)
|
||||||
|
|
||||||
@log_calls('PluginsWindow')
|
@log_calls('PluginsWindow')
|
||||||
def on_install_plugin_button_clicked(self, widget):
|
def on_install_plugin_button_clicked(self, widget):
|
||||||
|
|
|
@ -3401,8 +3401,8 @@ class RosterWindow:
|
||||||
|
|
||||||
def expand_group_row(self, path):
|
def expand_group_row(self, path):
|
||||||
self.tree.expand_row(path, False)
|
self.tree.expand_row(path, False)
|
||||||
iter = self.modelfilter.get_iter(path)
|
iter_ = self.modelfilter.get_iter(path)
|
||||||
child_iter = self.modelfilter.iter_children(iter)
|
child_iter = self.modelfilter.iter_children(iter_)
|
||||||
while child_iter:
|
while child_iter:
|
||||||
type_ = self.modelfilter[child_iter][Column.TYPE]
|
type_ = self.modelfilter[child_iter][Column.TYPE]
|
||||||
account = self.modelfilter[child_iter][Column.ACCOUNT]
|
account = self.modelfilter[child_iter][Column.ACCOUNT]
|
||||||
|
|
Loading…
Reference in New Issue