diff --git a/.pylintrc b/.pylintrc index 8a091e614..1cfda0b8a 100644 --- a/.pylintrc +++ b/.pylintrc @@ -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] diff --git a/deluge/__rpcapi.py b/deluge/__rpcapi.py index 79a15ea3c..0ce9efacc 100644 --- a/deluge/__rpcapi.py +++ b/deluge/__rpcapi.py @@ -13,7 +13,7 @@ from deluge.core.core import Core from deluge.core.daemon import Daemon -class RpcApi: +class RpcApi(object): pass diff --git a/deluge/configmanager.py b/deluge/configmanager.py index 263e03656..173ee3e93 100644 --- a/deluge/configmanager.py +++ b/deluge/configmanager.py @@ -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 = {} diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index 6f1d9bc8b..1d62b3d77 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -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 = [] diff --git a/deluge/plugins/Stats/deluge/plugins/stats/graph.py b/deluge/plugins/Stats/deluge/plugins/stats/graph.py index 085f4e261..7b11a3085 100644 --- a/deluge/plugins/Stats/deluge/plugins/stats/graph.py +++ b/deluge/plugins/Stats/deluge/plugins/stats/graph.py @@ -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 diff --git a/deluge/plugins/Stats/deluge/plugins/stats/tests/test_stats.py b/deluge/plugins/Stats/deluge/plugins/stats/tests/test_stats.py index 3134f9ec2..c9a980368 100644 --- a/deluge/plugins/Stats/deluge/plugins/stats/tests/test_stats.py +++ b/deluge/plugins/Stats/deluge/plugins/stats/tests/test_stats.py @@ -90,7 +90,7 @@ class StatsTestCase(BaseTestCase): TorrentDetails() Preferences() - class FakeFile: + class FakeFile(object): def __init__(self): self.data = [] diff --git a/deluge/ui/console/modes/input_popup.py b/deluge/ui/console/modes/input_popup.py index 6eeb68c91..903e7422d 100644 --- a/deluge/ui/console/modes/input_popup.py +++ b/deluge/ui/console/modes/input_popup.py @@ -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 diff --git a/deluge/ui/console/modes/popup.py b/deluge/ui/console/modes/popup.py index 42b5e3103..014209db1 100644 --- a/deluge/ui/console/modes/popup.py +++ b/deluge/ui/console/modes/popup.py @@ -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): """ diff --git a/deluge/ui/console/modes/preference_panes.py b/deluge/ui/console/modes/preference_panes.py index 103ee68b2..0c61d6d64 100644 --- a/deluge/ui/console/modes/preference_panes.py +++ b/deluge/ui/console/modes/preference_panes.py @@ -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 diff --git a/deluge/ui/console/modes/preferences.py b/deluge/ui/console/modes/preferences.py index 560cba1cb..f589916ad 100644 --- a/deluge/ui/console/modes/preferences.py +++ b/deluge/ui/console/modes/preferences.py @@ -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 diff --git a/deluge/ui/console/modes/torrent_actions.py b/deluge/ui/console/modes/torrent_actions.py index a728e22f9..d68730f41 100644 --- a/deluge/ui/console/modes/torrent_actions.py +++ b/deluge/ui/console/modes/torrent_actions.py @@ -50,7 +50,7 @@ torrent_options_to_names = { } -class ACTION: +class ACTION(object): PAUSE = 0 RESUME = 1 REANNOUNCE = 2 diff --git a/deluge/ui/gtkui/aboutdialog.py b/deluge/ui/gtkui/aboutdialog.py index f4516024e..8ef54e296 100644 --- a/deluge/ui/gtkui/aboutdialog.py +++ b/deluge/ui/gtkui/aboutdialog.py @@ -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) diff --git a/deluge/ui/gtkui/createtorrentdialog.py b/deluge/ui/gtkui/createtorrentdialog.py index f972450c5..6cf97c191 100644 --- a/deluge/ui/gtkui/createtorrentdialog.py +++ b/deluge/ui/gtkui/createtorrentdialog.py @@ -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 diff --git a/deluge/ui/gtkui/edittrackersdialog.py b/deluge/ui/gtkui/edittrackersdialog.py index 1ca2042d1..04718d4ad 100644 --- a/deluge/ui/gtkui/edittrackersdialog.py +++ b/deluge/ui/gtkui/edittrackersdialog.py @@ -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() diff --git a/deluge/ui/gtkui/listview.py b/deluge/ui/gtkui/listview.py index 79bb54f52..25796a4e2 100644 --- a/deluge/ui/gtkui/listview.py +++ b/deluge/ui/gtkui/listview.py @@ -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 diff --git a/deluge/ui/gtkui/new_release_dialog.py b/deluge/ui/gtkui/new_release_dialog.py index 6e70a57ce..b8f47dd42 100644 --- a/deluge/ui/gtkui/new_release_dialog.py +++ b/deluge/ui/gtkui/new_release_dialog.py @@ -13,7 +13,8 @@ from deluge.configmanager import ConfigManager from deluge.ui.client import client -class NewReleaseDialog: +class NewReleaseDialog(object): + def __init__(self): pass diff --git a/deluge/ui/gtkui/statusbar.py b/deluge/ui/gtkui/statusbar.py index 26be635b5..7d52d0224 100644 --- a/deluge/ui/gtkui/statusbar.py +++ b/deluge/ui/gtkui/statusbar.py @@ -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()