[Lint] Fix and remove old-style-class from ignore warnings

This commit is contained in:
bendikro 2016-05-03 12:26:35 +02:00 committed by Calum Lind
parent 3ec8dc6858
commit 1a2ff9b089
17 changed files with 31 additions and 26 deletions

View file

@ -62,15 +62,14 @@ confidence=
#
# Arranged by category: Convention, Error, Information, Refactor, Warning.
# Category per line (wrapped categories are indented) using symbolic names instead of ids.
disable=missing-docstring, invalid-name, old-style-class, bad-continuation, wrong-import-position,
disable=missing-docstring, invalid-name, bad-continuation, wrong-import-position,
wrong-import-order,
no-member, not-callable, no-name-in-module,
locally-disabled,
R,
unused-argument, fixme, protected-access, import-error, unused-variable,
global-statement, attribute-defined-outside-init, arguments-differ,
no-init, super-init-not-called,
broad-except
no-init, super-init-not-called, broad-except
[REPORTS]

View file

@ -13,7 +13,7 @@ from deluge.core.core import Core
from deluge.core.daemon import Daemon
class RpcApi:
class RpcApi(object):
pass

View file

@ -17,7 +17,7 @@ from deluge.config import Config
log = logging.getLogger(__name__)
class _ConfigManager:
class _ConfigManager(object):
def __init__(self):
log.debug("ConfigManager started..")
self.config_files = {}

View file

@ -34,8 +34,11 @@ from deluge.event import (PreTorrentRemovedEvent, SessionStartedEvent, TorrentAd
log = logging.getLogger(__name__)
class TorrentState:
"""Create a torrent state"""
class TorrentState: # pylint: disable=old-style-class
"""
Create a torrent state
This must be old style class to avoid breaking torrent.state file
"""
def __init__(self,
torrent_id=None,
filename=None,
@ -72,8 +75,10 @@ class TorrentState:
setattr(self, key, value)
class TorrentManagerState:
"""TorrentManagerState holds a list of TorrentState objects"""
class TorrentManagerState: # pylint: disable=old-style-class
"""TorrentManagerState holds a list of TorrentState objects
This must be old style class to avoid breaking torrent.state file
"""
def __init__(self):
self.torrents = []

View file

@ -56,7 +56,7 @@ def change_opacity(color, opactiy):
return tuple(color)
class Graph:
class Graph(object):
def __init__(self):
self.width = 100
self.height = 100

View file

@ -90,7 +90,7 @@ class StatsTestCase(BaseTestCase):
TorrentDetails()
Preferences()
class FakeFile:
class FakeFile(object):
def __init__(self):
self.data = []

View file

@ -24,7 +24,7 @@ from deluge.ui.console.modes.popup import ALIGN, Popup
log = logging.getLogger(__name__)
class InputField:
class InputField(object):
depend = None
# render the input. return number of rows taken up

View file

@ -19,7 +19,7 @@ from deluge.ui.console.modes import format_utils
log = logging.getLogger(__name__)
class ALIGN:
class ALIGN(object):
TOP_LEFT = 1
TOP_CENTER = 2
TOP_RIGHT = 3
@ -32,7 +32,7 @@ class ALIGN:
DEFAULT = MIDDLE_CENTER
class Popup:
class Popup(object):
def __init__(self, parent_mode, title, width_req=0, height_req=0, align=ALIGN.DEFAULT,
close_cb=None, init_lines=None):
"""

View file

@ -22,7 +22,7 @@ except ImportError:
log = logging.getLogger(__name__)
class NoInput:
class NoInput(object):
def depend_skip(self):
return False
@ -66,7 +66,7 @@ class InfoField(NoInput):
self.txt = "%s %s" % (self.label, self.value)
class BasePane:
class BasePane(object):
def __init__(self, offset, parent, width):
self.offset = offset + 1
self.parent = parent

View file

@ -70,7 +70,7 @@ Special keys for various input types are as follows:
HELP_LINES = HELP_STR.split("\n")
class ZONE:
class ZONE(object):
CATEGORIES = 0
PREFRENCES = 1
ACTIONS = 2

View file

@ -50,7 +50,7 @@ torrent_options_to_names = {
}
class ACTION:
class ACTION(object):
PAUSE = 0
RESUME = 1
REANNOUNCE = 2

View file

@ -17,7 +17,7 @@ from deluge.ui.gtkui.common import get_deluge_icon
pygtk.require('2.0')
class AboutDialog:
class AboutDialog(object):
def __init__(self):
def url_hook(dialog, url):
open_url_in_browser(url)

View file

@ -24,7 +24,7 @@ from deluge.ui.gtkui.torrentview_data_funcs import cell_data_size
log = logging.getLogger(__name__)
class CreateTorrentDialog:
class CreateTorrentDialog(object):
def __init__(self):
pass

View file

@ -22,7 +22,7 @@ from deluge.ui.gtkui.common import get_deluge_icon
log = logging.getLogger(__name__)
class EditTrackersDialog:
class EditTrackersDialog(object):
def __init__(self, torrent_id, parent=None):
self.torrent_id = torrent_id
self.builder = gtk.Builder()

View file

@ -23,7 +23,7 @@ signal_new('button-press-event', gtk.TreeViewColumn, SIGNAL_RUN_LAST, TYPE_NONE,
log = logging.getLogger(__name__)
class ListViewColumnState:
class ListViewColumnState(object):
"""Used for saving/loading column state"""
def __init__(self, name, position, width, visible, sort, sort_order):
self.name = name
@ -34,13 +34,13 @@ class ListViewColumnState:
self.sort_order = sort_order
class ListView:
class ListView(object):
"""ListView is used to make custom GtkTreeViews. It supports the adding
and removing of columns, creating a menu for a column toggle list and
support for 'status_field's which are used while updating the columns data.
"""
class ListViewColumn:
class ListViewColumn(object):
"""Holds information regarding a column in the ListView"""
def __init__(self, name, column_indices):
# Name is how a column is identified and is also the header

View file

@ -13,7 +13,8 @@ from deluge.configmanager import ConfigManager
from deluge.ui.client import client
class NewReleaseDialog:
class NewReleaseDialog(object):
def __init__(self):
pass

View file

@ -21,7 +21,7 @@ from deluge.ui.gtkui import common, dialogs
log = logging.getLogger(__name__)
class StatusBarItem:
class StatusBarItem(object):
def __init__(self, image=None, stock=None, text=None, callback=None, tooltip=None):
self._widgets = []
self._ebox = gtk.EventBox()