Fix pylint errors

- bad-mcs-method-argument
- trailing-newlines
- no-self-argument
This commit is contained in:
Philipp Hörist 2018-09-18 15:45:39 +02:00 committed by Philipp Hörist
parent 99efc4a9b4
commit e89dfccf73
3 changed files with 18 additions and 19 deletions

View File

@ -42,11 +42,11 @@ class CellRendererImage(Gtk.CellRendererPixbuf):
def do_get_property(self, pspec): def do_get_property(self, pspec):
return getattr(self, pspec.name) return getattr(self, pspec.name)
def do_activate(event, widget, path, bg_area, cell_area, flags): def do_activate(self, *args, **kwargs):
"""Renderers cannot be activated; always return True.""" """Renderers cannot be activated; always return True."""
return True return True
def do_editing_started(event, widget, path, fb_area, cell_area, flags): def do_editing_started(self, *args, **kwargs):
"""Renderers cannot be edited; always return None.""" """Renderers cannot be edited; always return None."""
return None return None

View File

@ -104,32 +104,32 @@ def list_commands(host):
class Dispatchable(type): class Dispatchable(type):
# pylint: disable=no-value-for-parameter # pylint: disable=no-value-for-parameter
def __init__(self, name, bases, namespace): def __init__(cls, name, bases, namespace):
parents = super(Dispatchable, self) parents = super(Dispatchable, cls)
parents.__init__(name, bases, namespace) parents.__init__(name, bases, namespace)
if not is_root(namespace): if not is_root(namespace):
self.dispatch() cls.dispatch()
def dispatch(self): def dispatch(cls):
if self.AUTOMATIC: if cls.AUTOMATIC:
self.enable() cls.enable()
class Host(Dispatchable): class Host(Dispatchable):
def enable(self): def enable(cls):
add_host(self) add_host(cls)
def disable(self): def disable(cls):
remove_host(self) remove_host(cls)
class Container(Dispatchable): class Container(Dispatchable):
def enable(self): def enable(cls):
add_container(self) add_container(cls)
add_commands(self) add_commands(cls)
def disable(self): def disable(cls):
remove_commands(self) remove_commands(cls)
remove_container(self) remove_container(cls)

View File

@ -400,4 +400,3 @@ class StandardGroupChatCommands(CommandContainer):
raise CommandError(_('Command is not supported for zeroconf accounts')) raise CommandError(_('Command is not supported for zeroconf accounts'))
gc_c = app.contacts.get_gc_contact(self.account, self.room_jid, nick) gc_c = app.contacts.get_gc_contact(self.account, self.room_jid, nick)
app.connections[self.account].get_module('Ping').send_ping(gc_c) app.connections[self.account].get_module('Ping').send_ping(gc_c)