[Lint] Update pylintrc and fixup code for newly introduced messages

* pylintrc is now compatible with pylint 1.6.
 * Add to ignore wrong-import-position and wrong-import-order as
   we use isort and pylint is raising too many incorrect messages.
This commit is contained in:
Calum Lind 2016-04-12 14:11:08 +01:00
parent 10e1a2a593
commit e468436b0c
10 changed files with 13 additions and 32 deletions

View File

@ -11,14 +11,12 @@ from .basetest import BaseTestCase
libs_available = True libs_available = True
# Allow running other tests without GTKUI dependencies available # Allow running other tests without GTKUI dependencies available
try: try:
from gobject import TYPE_UINT64
from deluge.ui.gtkui.mainwindow import MainWindow from deluge.ui.gtkui.mainwindow import MainWindow
from deluge.ui.gtkui.gtkui import DEFAULT_PREFS from deluge.ui.gtkui.gtkui import DEFAULT_PREFS
from deluge.ui.gtkui.files_tab import FilesTab from deluge.ui.gtkui.files_tab import FilesTab
except ImportError as err: except ImportError as err:
libs_available = False libs_available = False
TYPE_UINT64 = "Whatever"
import traceback import traceback
traceback.print_exc() traceback.print_exc()

View File

@ -59,8 +59,8 @@ class TrackerIconsTestCase(BaseTestCase):
return d return d
def test_get_openbt_png(self): def test_get_openbt_png(self):
raise SkipTest("Site is down, possibly permanently") raise SkipTest("openbittorrent.com site is down, possibly permanently")
# openbittorrent.com has an incorrect type (image/gif) # openbittorrent.com has an incorrect type (image/gif) pylint: disable=unreachable
icon = TrackerIcon(os.path.join(dirname, "openbt.png")) icon = TrackerIcon(os.path.join(dirname, "openbt.png"))
d = self.icons.fetch("openbittorrent.com") d = self.icons.fetch("openbittorrent.com")
d.addCallback(self.assertNotIdentical, None) d.addCallback(self.assertNotIdentical, None)

View File

@ -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) 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)) 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 # 32-bit color depth icon image allows semitransparent areas
# PIL's DIB format ignores transparency bits, recover them # PIL's DIB format ignores transparency bits, recover them
# The DIB is packed in BGRX byte order where X is the alpha channel # The DIB is packed in BGRX byte order where X is the alpha channel

View File

@ -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["download_location"] = os.path.expanduser(options["path"])
t_options["add_paused"] = options["add_paused"] 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_url = (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_magnet = not(is_url) and (options["path_type"] != 1) and deluge.common.is_magnet(t_file)
if is_url or is_magnet: if is_url or is_magnet:
files = [t_file] files = [t_file]

View File

@ -193,7 +193,7 @@ class EditTrackersDialog:
num_rows = self.liststore.iter_n_children(None) num_rows = self.liststore.iter_n_children(None)
if selected is not None and num_rows > 1: if selected is not None and num_rows > 1:
tier = self.liststore.get_value(selected, 0) tier = self.liststore.get_value(selected, 0)
if not tier > 0: if tier <= 0:
return return
new_tier = tier - 1 new_tier = tier - 1
# Now change the tier for this tracker # Now change the tier for this tracker

View File

@ -186,7 +186,7 @@ class GtkUI(object):
self.started_in_classic = self.config["classic_mode"] self.started_in_classic = self.config["classic_mode"]
# Set language # Set language
if not self.config["language"] is None: if self.config["language"] is not None:
deluge.common.set_language(self.config["language"]) deluge.common.set_language(self.config["language"])
# Start the IPC Interface before anything else.. Just in case we are # Start the IPC Interface before anything else.. Just in case we are

View File

@ -184,13 +184,13 @@ class OptionsTab(Tab):
) )
if self.chk_prioritize_first_last.get_active() != \ if self.chk_prioritize_first_last.get_active() != \
self.prev_status["prioritize_first_last"] and \ 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( client.core.set_torrent_prioritize_first_last(
self.prev_torrent_id, self.chk_prioritize_first_last.get_active() self.prev_torrent_id, self.chk_prioritize_first_last.get_active()
) )
if self.chk_sequential_download.get_active() != \ if self.chk_sequential_download.get_active() != \
self.prev_status["sequential_download"] and \ self.prev_status["sequential_download"] and \
not self.prev_status["storage_mode"] == "compact": self.prev_status["storage_mode"] != "compact":
client.core.set_torrent_options( client.core.set_torrent_options(
[self.prev_torrent_id], {"sequential_download": self.chk_sequential_download.get_active()} [self.prev_torrent_id], {"sequential_download": self.chk_sequential_download.get_active()}
) )

View File

@ -78,7 +78,7 @@ class Preferences(component.Component):
i += 1 i += 1
def set_separator(model, _iter, data=None): def set_separator(model, _iter, data=None):
if "_separator_" == model.get_value(_iter, 1): if model.get_value(_iter, 1) == "_separator_":
return True return True
self.treeview.set_row_separator_func(set_separator) self.treeview.set_row_separator_func(set_separator)

View File

@ -673,7 +673,7 @@ class TorrentView(ListView, component.Component):
def on_torrentstatechanged_event(self, torrent_id, state): def on_torrentstatechanged_event(self, torrent_id, state):
# Update the torrents state # Update the torrents state
for row in self.liststore: 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 continue
for name in self.columns_to_update: for name in self.columns_to_update:

View File

@ -7,9 +7,6 @@
# pygtk.require(). # pygtk.require().
#init-hook= #init-hook=
# Profiled execution.
profile=no
# Add files or directories to the blacklist. They should be base names, not # Add files or directories to the blacklist. They should be base names, not
# paths. # paths.
ignore=CVS ignore=CVS
@ -65,7 +62,8 @@ confidence=
# #
# Arranged by category: Convention, Error, Information, Refactor, Warning. # Arranged by category: Convention, Error, Information, Refactor, Warning.
# Category per line (wrapped categories are indented) using symbolic names instead of ids. # 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, no-member, not-callable, no-name-in-module, super-on-old-class,
locally-disabled, locally-disabled,
R, R,
@ -96,10 +94,6 @@ reports=no
# (RP0004). # (RP0004).
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) 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 # Template used to display messages. This is a python new-style format string
# used to format the message information. See doc for all details # used to format the message information. See doc for all details
#msg-template= #msg-template=
@ -124,9 +118,6 @@ spelling-store-unknown-words=no
[BASIC] [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 # List of builtins function names that should not be used, separated by a comma
bad-functions=map,filter,input bad-functions=map,filter,input
@ -287,10 +278,6 @@ ignored-modules=
# (useful for classes with attributes dynamically set). # (useful for classes with attributes dynamically set).
ignored-classes=SQLObject,twisted.internet.reactor 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 # List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E0201 when accessed. Python regular # system, and so shouldn't trigger E0201 when accessed. Python regular
# expressions are accepted. # expressions are accepted.
@ -366,10 +353,6 @@ max-public-methods=20
[CLASSES] [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. # List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,__new__,setUp defining-attr-methods=__init__,__new__,setUp