[Lint] Fix couple of pylint complaints

This commit is contained in:
bendikro 2016-11-02 09:12:55 +01:00 committed by Calum Lind
parent f96b9c8a23
commit 61b059f015
6 changed files with 10 additions and 8 deletions

View File

@ -63,7 +63,7 @@ class BadIP(Exception):
_message = None
def __init__(self, message):
self.message = message
super(BadIP, self).__init__(message)
def __set_message(self, message):
self._message = message

View File

@ -141,7 +141,7 @@ class Win32IcoFile(object):
# figure out where AND mask image starts
mode = a[0]
bpp = 8
for k in PIL.BmpImagePlugin.BIT2MODE.keys():
for k in PIL.BmpImagePlugin.BIT2MODE:
if mode == PIL.BmpImagePlugin.BIT2MODE[k][1]:
bpp = k
break
@ -214,7 +214,7 @@ class Win32IcoFile(object):
# end Win32IcoFile
class Win32IconImageFile(PIL.ImageFile.ImageFile):
class Win32IconImageFile(PIL.ImageFile.ImageFile): # pylint: disable=abstract-method
"""
PIL read-only image support for Microsoft .ico files.

View File

@ -7,10 +7,11 @@
# See LICENSE for more details.
#
UI_PATH = __path__[0] # NOQA Ignore 'E402 module level import not at top of file'
from deluge.ui.console.console import Console
UI_PATH = __path__[0]
def start():
Console().start()

View File

@ -15,7 +15,6 @@ import sys
import deluge.common
from deluge.ui.baseargparser import BaseArgParser, DelugeTextHelpFormatter
from deluge.ui.console import UI_PATH
from deluge.ui.ui import UI
log = logging.getLogger(__name__)
@ -87,6 +86,7 @@ class Console(UI):
subparsers = self.console_parser.add_subparsers(title=_("Console commands"), help=_("Description"),
description=_("The following console commands are available:"),
metavar=_("Command"), dest="command")
from deluge.ui.console import UI_PATH # Must import here
self.console_cmds = load_commands(os.path.join(UI_PATH, "cmdline", "commands"))
for c in sorted(self.console_cmds):
self.console_cmds[c].add_subparser(subparsers)

View File

@ -172,10 +172,10 @@ class OptionsTab(Tab):
if self.spin_max_upload_slots.get_value_as_int() != self.prev_status["max_upload_slots"]:
client.core.set_torrent_max_upload_slots(
self.prev_torrent_id, self.spin_max_upload_slots.get_value_as_int())
if (self.chk_prioritize_first_last.get_active() != self.prev_status["prioritize_first_last"]):
if self.chk_prioritize_first_last.get_active() != self.prev_status["prioritize_first_last"]:
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"]):
if self.chk_sequential_download.get_active() != self.prev_status["sequential_download"]:
client.core.set_torrent_options(
[self.prev_torrent_id], {"sequential_download": self.chk_sequential_download.get_active()})
if self.chk_auto_managed.get_active() != self.prev_status["is_auto_managed"]:

View File

@ -124,6 +124,7 @@ commands = flake8 --exit-zero --max-complexity 15 deluge
[testenv:pylint]
# Disable site packages to avoid using system installed version
sitepackages = False
ignore_errors = True
deps =
{[testenv]deps}
pylint