[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:
parent
10e1a2a593
commit
e468436b0c
|
@ -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()
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()}
|
||||
)
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
21
pylintrc
21
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue