Fix useless-object-inheritance pylint errors

This commit is contained in:
Philipp Hörist 2018-09-16 11:56:56 +02:00 committed by Philipp Hörist
parent 4f14e19308
commit 7cf53e901b
23 changed files with 28 additions and 29 deletions

View File

@ -64,7 +64,7 @@ def tree_model_pre_order(model, treeiter):
yield it yield it
class AdvancedConfigurationWindow(object): class AdvancedConfigurationWindow:
def __init__(self, transient): def __init__(self, transient):
self.xml = gtkgui_helpers.get_gtk_builder('advanced_configuration_window.ui') self.xml = gtkgui_helpers.get_gtk_builder('advanced_configuration_window.ui')
self.window = self.xml.get_object('advanced_configuration_window') self.window = self.xml.get_object('advanced_configuration_window')

View File

@ -55,7 +55,7 @@ class CommandContainer(metaclass=Container):
""" """
__metaclass__ = Container __metaclass__ = Container
class CommandProcessor(object): class CommandProcessor:
""" """
Command processor is an immediate command emitter. It does not Command processor is an immediate command emitter. It does not
participate in the dispatching process directly, but must define a participate in the dispatching process directly, but must define a
@ -145,7 +145,7 @@ class CommandProcessor(object):
commands = dict(commands) commands = dict(commands)
return sorted(set(commands.values()), key=lambda k: k.__repr__()) return sorted(set(commands.values()), key=lambda k: k.__repr__())
class Command(object): class Command:
def __init__(self, handler, *names, **properties): def __init__(self, handler, *names, **properties):
self.handler = handler self.handler = handler

View File

@ -15,7 +15,7 @@
# along with Gajim. If not, see <http://www.gnu.org/licenses/>. # along with Gajim. If not, see <http://www.gnu.org/licenses/>.
class Account(object): class Account:
def __init__(self, name, contacts, gc_contacts): def __init__(self, name, contacts, gc_contacts):
self.name = name self.name = name

View File

@ -152,7 +152,7 @@ def compute_caps_hash(identities, features, dataforms=None, hash_method='sha-1')
### Internal classes of this module ### Internal classes of this module
################################################################################ ################################################################################
class AbstractClientCaps(object): class AbstractClientCaps:
""" """
Base class representing a client and its capabilities as advertised by a Base class representing a client and its capabilities as advertised by a
caps tag in a presence caps tag in a presence
@ -282,7 +282,7 @@ class NullClientCaps(AbstractClientCaps):
return False return False
class CapsCache(object): class CapsCache:
""" """
This object keeps the mapping between caps data and real disco features they This object keeps the mapping between caps data and real disco features they
represent, and provides simple way to query that info represent, and provides simple way to query that info
@ -295,7 +295,7 @@ class CapsCache(object):
# client (hash method/hash pair) # client (hash method/hash pair)
self.__cache = {} self.__cache = {}
class CacheItem(object): class CacheItem:
# __names is a string cache; every string long enough is given # __names is a string cache; every string long enough is given
# another object, and we will have plenty of identical long # another object, and we will have plenty of identical long
# strings. therefore we can cache them # strings. therefore we can cache them

View File

@ -32,7 +32,7 @@ except ImportError as e:
if __name__ != "__main__": if __name__ != "__main__":
raise ImportError(str(e)) raise ImportError(str(e))
class XMPPEntity(object): class XMPPEntity:
""" """
Base representation of entities in XMPP Base representation of entities in XMPP
""" """

View File

@ -90,7 +90,7 @@ class FilesProp:
del files_props[a, s] del files_props[a, s]
class FileProp(object): class FileProp:
def __init__(self, account, sid): def __init__(self, account, sid):
# Do not instantiate this class directly. Call FilesProp.getNeFileProp # Do not instantiate this class directly. Call FilesProp.getNeFileProp

View File

@ -52,7 +52,7 @@ OUT_PRECORE = 90
OUT_CORE = 100 OUT_CORE = 100
OUT_POSTCORE = 110 OUT_POSTCORE = 110
class GlobalEventsDispatcher(object): class GlobalEventsDispatcher:
def __init__(self): def __init__(self):
self.handlers = {} self.handlers = {}

View File

@ -43,7 +43,7 @@ if app.is_installed('FARSTREAM'):
logger = logging.getLogger('gajim.c.jingle') logger = logging.getLogger('gajim.c.jingle')
class ConnectionJingle(object): class ConnectionJingle:
""" """
This object depends on that it is a part of Connection class. This object depends on that it is a part of Connection class.
""" """

View File

@ -22,7 +22,7 @@ from gi.repository import Gst
log = logging.getLogger('gajim.c.multimedia_helpers') log = logging.getLogger('gajim.c.multimedia_helpers')
class DeviceManager(object): class DeviceManager:
def __init__(self): def __init__(self):
self.devices = {} self.devices = {}

View File

@ -35,7 +35,7 @@ except ImportError:
log.debug('python-keyring missing, falling back to plaintext storage') log.debug('python-keyring missing, falling back to plaintext storage')
class PasswordStorage(object): class PasswordStorage:
"""Interface for password stores""" """Interface for password stores"""
def get_password(self, account_name): def get_password(self, account_name):
"""Return the password for account_name, or None if not found.""" """Return the password for account_name, or None if not found."""

View File

@ -25,7 +25,7 @@ log = logging.getLogger('gajim.c.pep')
from gajim.common import app from gajim.common import app
class AbstractPEP(object): class AbstractPEP:
type_ = '' type_ = ''
namespace = '' namespace = ''

View File

@ -450,7 +450,7 @@ class SocksQueue:
if sock.host != host_to_keep and sock.mode == 'server': if sock.host != host_to_keep and sock.mode == 'server':
self.remove_sender_by_key(key) self.remove_sender_by_key(key)
class Socks5(object): class Socks5:
def __init__(self, idlequeue, host, port, initiator, target, sid): def __init__(self, idlequeue, host, port, initiator, target, sid):
if host is not None: if host is not None:
try: try:

View File

@ -294,7 +294,7 @@ class ManageProxiesWindow:
app.config.set_per('proxies', proxy, 'pass', value) app.config.set_per('proxies', proxy, 'pass', value)
class FakeDataForm(Gtk.Table, object): class FakeDataForm(Gtk.Table):
""" """
Class for forms that are in XML format <entry1>value1</entry1> infos in a Class for forms that are in XML format <entry1>value1</entry1> infos in a
table {entry1: value1} table {entry1: value1}

View File

@ -36,7 +36,7 @@ from gajim.common import app
import itertools import itertools
class DataFormWidget(Gtk.Alignment, object): class DataFormWidget(Gtk.Alignment):
# "public" interface # "public" interface
""" """
Data Form widget. Use like any other widget Data Form widget. Use like any other widget
@ -306,7 +306,7 @@ class DataFormWidget(Gtk.Alignment, object):
def on_records_selection_changed(self, widget): def on_records_selection_changed(self, widget):
self.refresh_multiple_buttons() self.refresh_multiple_buttons()
class SingleForm(Gtk.Table, object): class SingleForm(Gtk.Table):
""" """
Widget that represent DATAFORM_SINGLE mode form. Because this is used not Widget that represent DATAFORM_SINGLE mode form. Because this is used not
only to display single forms, but to form input windows of multiple-type only to display single forms, but to form input windows of multiple-type

View File

@ -1583,7 +1583,7 @@ class ResourceConflictDialog(TimeoutDialog, InputDialog):
class VoIPCallReceivedDialog(object): class VoIPCallReceivedDialog:
instances = {} instances = {}
def __init__(self, account, contact_jid, sid, content_types): def __init__(self, account, contact_jid, sid, content_types):
self.instances[(contact_jid, sid)] = self self.instances[(contact_jid, sid)] = self

View File

@ -205,7 +205,7 @@ def get_agent_address(jid, node = None):
else: else:
return str(jid) return str(jid)
class Closure(object): class Closure:
""" """
A weak reference to a callback with arguments as an object A weak reference to a callback with arguments as an object
@ -474,8 +474,7 @@ class ServicesCache:
del self._cbs[cbkey] del self._cbs[cbkey]
# object is needed so that @property works class ServiceDiscoveryWindow:
class ServiceDiscoveryWindow(object):
""" """
Class that represents the Services Discovery window Class that represents the Services Discovery window
""" """

View File

@ -36,7 +36,7 @@ TYPE_PM = 'pm'
#################### ####################
class MessageControl(object): class MessageControl:
""" """
An abstract base widget that can embed in the Gtk.Notebook of a An abstract base widget that can embed in the Gtk.Notebook of a
MessageWindow MessageWindow

View File

@ -41,7 +41,7 @@ from gajim.common.i18n import Q_
#################### ####################
class MessageWindow(object): class MessageWindow:
""" """
Class for windows which contain message like things; chats, groupchats, etc Class for windows which contain message like things; chats, groupchats, etc
""" """

View File

@ -29,7 +29,7 @@ log = logging.getLogger('gajim.music_track_listener')
MPRIS_PLAYER_PREFIX = 'org.mpris.MediaPlayer2.' MPRIS_PLAYER_PREFIX = 'org.mpris.MediaPlayer2.'
class MusicTrackInfo(object): class MusicTrackInfo:
__slots__ = ['title', 'album', 'artist', 'duration', 'track_number', __slots__ = ['title', 'album', 'artist', 'duration', 'track_number',
'paused'] 'paused']

View File

@ -33,7 +33,7 @@ import logging
log = logging.getLogger('gajim.p.plugin') log = logging.getLogger('gajim.p.plugin')
class GajimPlugin(object): class GajimPlugin:
''' '''
Base class for implementing Gajim plugins. Base class for implementing Gajim plugins.
''' '''

View File

@ -51,7 +51,7 @@ class Column(IntEnum):
ICON = 4 ICON = 4
class PluginsWindow(object): class PluginsWindow:
'''Class for Plugins window''' '''Class for Plugins window'''
@log_calls('PluginsWindow') @log_calls('PluginsWindow')

View File

@ -39,7 +39,7 @@ class GajimPluginActivateException(Exception):
''' '''
pass pass
class log_calls(object): class log_calls:
''' '''
Decorator class for functions to easily log when they are entered and left. Decorator class for functions to easily log when they are entered and left.
''' '''

View File

@ -33,7 +33,7 @@ from gajim.common.const import KindConstant
from gajim.gtk import SingleMessageWindow from gajim.gtk import SingleMessageWindow
class ChatControlSession(object): class ChatControlSession:
def __init__(self, conn, jid, thread_id, type_='chat'): def __init__(self, conn, jid, thread_id, type_='chat'):
self.conn = conn self.conn = conn
self.jid = jid self.jid = jid