Commit 4c38a309 authored by Philipp Hörist's avatar Philipp Hörist Committed by Philipp Hörist
Browse files

Fix pylint errors

- deprecated-method
- anomalous-backslash-in-string
- cell-var-from-loop
- undefined-loop-variable
parent 16f76202
......@@ -215,7 +215,7 @@ def extract_specification(self):
Extract handler's arguments specification, as it was defined
preserving their order.
"""
names, var_args, var_kwargs, defaults = getargspec(self.handler)
names, var_args, var_kwargs, defaults = getargspec(self.handler) # pylint: disable=W1505
# Behavior of this code need to be checked. Might yield
# incorrect results on some rare occasions.
......
......@@ -48,7 +48,7 @@ class Option(IntEnum):
opt_int = ['integer', 0]
opt_str = ['string', 0]
opt_bool = ['boolean', 0]
opt_color = ['color', '^(#[0-9a-fA-F]{6})|()|rgb\(\d+,\d+,\d+\)|rgba\(\d+,\d+,\d+,[01]\.?\d*\)$']
opt_color = ['color', r'(#[0-9a-fA-F]{6})|rgb\(\d+,\d+,\d+\)|rgba\(\d+,\d+,\d+,[01]\.?\d*\)']
opt_one_window_types = ['never', 'always', 'always_with_roster', 'peracct', 'pertype']
opt_show_roster_on_startup = ['always', 'never', 'last_state']
opt_treat_incoming_messages = ['', 'chat', 'normal']
......
......@@ -59,7 +59,7 @@ def read(self):
for line in fd:
match = regex.match(line)
if match is None:
log.warn('Invalid configuration line, ignoring it: %s', line)
log.warning('Invalid configuration line, ignoring it: %s', line)
continue
optname, key, subname, value = match.groups()
if key is None:
......
......@@ -121,7 +121,7 @@ def _parse_name(fullname):
}
# Split on '.' but do not split on '\.'
result = re.split('(?<!\\\\)\.', fullname)
result = re.split(r'(?<!\\\\)\.', fullname)
name = result[0]
protocol, domain = result[2:4]
......
......@@ -428,12 +428,12 @@ def on_list_single_combobox_changed(combobox, f):
widget.set_sensitive(readwrite)
else:
# more than 5 options: show combobox
def on_list_multi_treeview_changed(selection, f):
def for_selected(treemodel, path, iter_):
def on_list_multi_treeview_changed(selection, field_):
def for_selected(treemodel, _path, iter_):
vals.append(treemodel[iter_][1])
vals = []
selection.selected_foreach(for_selected)
field.values = vals[:]
field_.values = vals[:]
widget = Gtk.ScrolledWindow()
widget.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
tv = gtkgui_helpers.create_list_multi(field.options,
......
......@@ -104,6 +104,7 @@ def remove_group(self, group):
account, [group])
# FIXME: Ugly workaround.
# pylint: disable=undefined-loop-variable
app.interface.roster.draw_group(_('General'), account)
def add_group(self, group):
......@@ -116,6 +117,7 @@ def add_group(self, group):
# FIXME: Ugly workaround.
# Maybe we haven't been in any group (defaults to General)
# pylint: disable=undefined-loop-variable
app.interface.roster.draw_group(_('General'), account)
def on_add_button_clicked(self, widget):
......@@ -1692,17 +1694,15 @@ def on_voip_call_received_messagedialog_response(self, dialog, response):
out_xid = ctrl.xml.get_object('outgoing_drawingarea').\
get_property('window').get_xid()
b = content.src_bin
found = False
for e in b.children:
if e.get_name().startswith('autovideosink'):
found = True
break
if found:
if not e.get_name().startswith('autovideosink'):
continue
for f in e.children:
if f.get_name().startswith('autovideosink'):
f.set_window_handle(out_xid)
content.out_xid = out_xid
break
break
content.in_xid = in_xid
ctrl.set_video_state('connecting', self.sid)
# Now, accept the content/sessions.
......
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