diff --git a/deluge/tests/test_files_tab.py b/deluge/tests/test_files_tab.py index a068e2ba0..11696c72c 100644 --- a/deluge/tests/test_files_tab.py +++ b/deluge/tests/test_files_tab.py @@ -11,14 +11,12 @@ from .basetest import BaseTestCase libs_available = True # Allow running other tests without GTKUI dependencies available try: - from gobject import TYPE_UINT64 from deluge.ui.gtkui.mainwindow import MainWindow from deluge.ui.gtkui.gtkui import DEFAULT_PREFS from deluge.ui.gtkui.files_tab import FilesTab except ImportError as err: libs_available = False - TYPE_UINT64 = "Whatever" import traceback traceback.print_exc() diff --git a/deluge/tests/test_tracker_icons.py b/deluge/tests/test_tracker_icons.py index f36b7df39..57304f0f1 100644 --- a/deluge/tests/test_tracker_icons.py +++ b/deluge/tests/test_tracker_icons.py @@ -59,8 +59,8 @@ class TrackerIconsTestCase(BaseTestCase): return d def test_get_openbt_png(self): - raise SkipTest("Site is down, possibly permanently") - # openbittorrent.com has an incorrect type (image/gif) + raise SkipTest("openbittorrent.com site is down, possibly permanently") + # openbittorrent.com has an incorrect type (image/gif) pylint: disable=unreachable icon = TrackerIcon(os.path.join(dirname, "openbt.png")) d = self.icons.fetch("openbittorrent.com") d.addCallback(self.assertNotIdentical, None) diff --git a/deluge/ui/Win32IconImagePlugin.py b/deluge/ui/Win32IconImagePlugin.py index ef3762a22..7de9528fd 100644 --- a/deluge/ui/Win32IconImagePlugin.py +++ b/deluge/ui/Win32IconImagePlugin.py @@ -147,7 +147,7 @@ class Win32IcoFile(object): log.debug("o:%s, w:%s, h:%s, bpp:%s", o, im.size[0], im.size[1], bpp) and_mask_offset = o + (im.size[0] * im.size[1] * (bpp / 8.0)) - if 32 == bpp: + if bpp == 32: # 32-bit color depth icon image allows semitransparent areas # PIL's DIB format ignores transparency bits, recover them # The DIB is packed in BGRX byte order where X is the alpha channel diff --git a/deluge/ui/console/modes/add_util.py b/deluge/ui/console/modes/add_util.py index ed4d18bb6..aee22660e 100644 --- a/deluge/ui/console/modes/add_util.py +++ b/deluge/ui/console/modes/add_util.py @@ -42,8 +42,8 @@ def add_torrent(t_file, options, success_cb, fail_cb, ress): t_options["download_location"] = os.path.expanduser(options["path"]) t_options["add_paused"] = options["add_paused"] - is_url = (not options["path_type"] == 1) and (deluge.common.is_url(t_file) or options["path_type"] == 2) - is_magnet = not(is_url) and (not options["path_type"] == 1) and deluge.common.is_magnet(t_file) + is_url = (options["path_type"] != 1) and (deluge.common.is_url(t_file) or options["path_type"] == 2) + is_magnet = not(is_url) and (options["path_type"] != 1) and deluge.common.is_magnet(t_file) if is_url or is_magnet: files = [t_file] diff --git a/deluge/ui/gtkui/edittrackersdialog.py b/deluge/ui/gtkui/edittrackersdialog.py index 00836d58d..1ca2042d1 100644 --- a/deluge/ui/gtkui/edittrackersdialog.py +++ b/deluge/ui/gtkui/edittrackersdialog.py @@ -193,7 +193,7 @@ class EditTrackersDialog: num_rows = self.liststore.iter_n_children(None) if selected is not None and num_rows > 1: tier = self.liststore.get_value(selected, 0) - if not tier > 0: + if tier <= 0: return new_tier = tier - 1 # Now change the tier for this tracker diff --git a/deluge/ui/gtkui/gtkui.py b/deluge/ui/gtkui/gtkui.py index e12001870..8deb36ed2 100644 --- a/deluge/ui/gtkui/gtkui.py +++ b/deluge/ui/gtkui/gtkui.py @@ -186,7 +186,7 @@ class GtkUI(object): self.started_in_classic = self.config["classic_mode"] # Set language - if not self.config["language"] is None: + if self.config["language"] is not None: deluge.common.set_language(self.config["language"]) # Start the IPC Interface before anything else.. Just in case we are diff --git a/deluge/ui/gtkui/options_tab.py b/deluge/ui/gtkui/options_tab.py index df1fcdfe1..e15524f6c 100644 --- a/deluge/ui/gtkui/options_tab.py +++ b/deluge/ui/gtkui/options_tab.py @@ -184,13 +184,13 @@ class OptionsTab(Tab): ) if self.chk_prioritize_first_last.get_active() != \ self.prev_status["prioritize_first_last"] and \ - not self.prev_status["storage_mode"] == "compact": + self.prev_status["storage_mode"] != "compact": client.core.set_torrent_prioritize_first_last( self.prev_torrent_id, self.chk_prioritize_first_last.get_active() ) if self.chk_sequential_download.get_active() != \ self.prev_status["sequential_download"] and \ - not self.prev_status["storage_mode"] == "compact": + self.prev_status["storage_mode"] != "compact": client.core.set_torrent_options( [self.prev_torrent_id], {"sequential_download": self.chk_sequential_download.get_active()} ) diff --git a/deluge/ui/gtkui/preferences.py b/deluge/ui/gtkui/preferences.py index 6ae5d00e6..e9b27a87c 100644 --- a/deluge/ui/gtkui/preferences.py +++ b/deluge/ui/gtkui/preferences.py @@ -78,7 +78,7 @@ class Preferences(component.Component): i += 1 def set_separator(model, _iter, data=None): - if "_separator_" == model.get_value(_iter, 1): + if model.get_value(_iter, 1) == "_separator_": return True self.treeview.set_row_separator_func(set_separator) diff --git a/deluge/ui/gtkui/torrentview.py b/deluge/ui/gtkui/torrentview.py index e9d234c20..38eb45220 100644 --- a/deluge/ui/gtkui/torrentview.py +++ b/deluge/ui/gtkui/torrentview.py @@ -673,7 +673,7 @@ class TorrentView(ListView, component.Component): def on_torrentstatechanged_event(self, torrent_id, state): # Update the torrents state for row in self.liststore: - if not torrent_id == row[self.columns["torrent_id"].column_indices[0]]: + if torrent_id != row[self.columns["torrent_id"].column_indices[0]]: continue for name in self.columns_to_update: diff --git a/pylintrc b/pylintrc index b9db49a3b..42b589b82 100644 --- a/pylintrc +++ b/pylintrc @@ -7,9 +7,6 @@ # pygtk.require(). #init-hook= -# Profiled execution. -profile=no - # Add files or directories to the blacklist. They should be base names, not # paths. ignore=CVS @@ -65,7 +62,8 @@ 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, +disable=missing-docstring, invalid-name, old-style-class, bad-continuation, wrong-import-position, + wrong-import-order, no-member, not-callable, no-name-in-module, super-on-old-class, locally-disabled, R, @@ -96,10 +94,6 @@ reports=no # (RP0004). evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) -# Add a comment according to your evaluation note. This is used by the global -# evaluation report (RP0004). -comment=no - # Template used to display messages. This is a python new-style format string # used to format the message information. See doc for all details #msg-template= @@ -124,9 +118,6 @@ spelling-store-unknown-words=no [BASIC] -# Required attributes for module, separated by a comma -required-attributes= - # List of builtins function names that should not be used, separated by a comma bad-functions=map,filter,input @@ -287,10 +278,6 @@ ignored-modules= # (useful for classes with attributes dynamically set). ignored-classes=SQLObject,twisted.internet.reactor -# When zope mode is activated, add a predefined set of Zope acquired attributes -# to generated-members. -zope=no - # List of members which are set dynamically and missed by pylint inference # system, and so shouldn't trigger E0201 when accessed. Python regular # expressions are accepted. @@ -366,10 +353,6 @@ max-public-methods=20 [CLASSES] -# List of interface methods to ignore, separated by a comma. This is used for -# instance to not check methods defines in Zope's Interface base class. -ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by - # List of method names used to declare (i.e. assign) instance attributes. defining-attr-methods=__init__,__new__,setUp