mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-05 07:58:38 +00:00
[Lint] Fix couple of pylint complaints
This commit is contained in:
parent
f96b9c8a23
commit
61b059f015
6 changed files with 10 additions and 8 deletions
|
@ -63,7 +63,7 @@ class BadIP(Exception):
|
||||||
_message = None
|
_message = None
|
||||||
|
|
||||||
def __init__(self, message):
|
def __init__(self, message):
|
||||||
self.message = message
|
super(BadIP, self).__init__(message)
|
||||||
|
|
||||||
def __set_message(self, message):
|
def __set_message(self, message):
|
||||||
self._message = message
|
self._message = message
|
||||||
|
|
|
@ -141,7 +141,7 @@ class Win32IcoFile(object):
|
||||||
# figure out where AND mask image starts
|
# figure out where AND mask image starts
|
||||||
mode = a[0]
|
mode = a[0]
|
||||||
bpp = 8
|
bpp = 8
|
||||||
for k in PIL.BmpImagePlugin.BIT2MODE.keys():
|
for k in PIL.BmpImagePlugin.BIT2MODE:
|
||||||
if mode == PIL.BmpImagePlugin.BIT2MODE[k][1]:
|
if mode == PIL.BmpImagePlugin.BIT2MODE[k][1]:
|
||||||
bpp = k
|
bpp = k
|
||||||
break
|
break
|
||||||
|
@ -214,7 +214,7 @@ class Win32IcoFile(object):
|
||||||
# end Win32IcoFile
|
# 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.
|
PIL read-only image support for Microsoft .ico files.
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,11 @@
|
||||||
# See LICENSE for more details.
|
# 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
|
from deluge.ui.console.console import Console
|
||||||
|
|
||||||
|
UI_PATH = __path__[0]
|
||||||
|
|
||||||
|
|
||||||
def start():
|
def start():
|
||||||
|
|
||||||
Console().start()
|
Console().start()
|
||||||
|
|
|
@ -15,7 +15,6 @@ import sys
|
||||||
|
|
||||||
import deluge.common
|
import deluge.common
|
||||||
from deluge.ui.baseargparser import BaseArgParser, DelugeTextHelpFormatter
|
from deluge.ui.baseargparser import BaseArgParser, DelugeTextHelpFormatter
|
||||||
from deluge.ui.console import UI_PATH
|
|
||||||
from deluge.ui.ui import UI
|
from deluge.ui.ui import UI
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
@ -87,6 +86,7 @@ class Console(UI):
|
||||||
subparsers = self.console_parser.add_subparsers(title=_("Console commands"), help=_("Description"),
|
subparsers = self.console_parser.add_subparsers(title=_("Console commands"), help=_("Description"),
|
||||||
description=_("The following console commands are available:"),
|
description=_("The following console commands are available:"),
|
||||||
metavar=_("Command"), dest="command")
|
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"))
|
self.console_cmds = load_commands(os.path.join(UI_PATH, "cmdline", "commands"))
|
||||||
for c in sorted(self.console_cmds):
|
for c in sorted(self.console_cmds):
|
||||||
self.console_cmds[c].add_subparser(subparsers)
|
self.console_cmds[c].add_subparser(subparsers)
|
||||||
|
|
|
@ -172,10 +172,10 @@ class OptionsTab(Tab):
|
||||||
if self.spin_max_upload_slots.get_value_as_int() != self.prev_status["max_upload_slots"]:
|
if self.spin_max_upload_slots.get_value_as_int() != self.prev_status["max_upload_slots"]:
|
||||||
client.core.set_torrent_max_upload_slots(
|
client.core.set_torrent_max_upload_slots(
|
||||||
self.prev_torrent_id, self.spin_max_upload_slots.get_value_as_int())
|
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(
|
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() != self.prev_status["sequential_download"]):
|
if self.chk_sequential_download.get_active() != self.prev_status["sequential_download"]:
|
||||||
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()})
|
||||||
if self.chk_auto_managed.get_active() != self.prev_status["is_auto_managed"]:
|
if self.chk_auto_managed.get_active() != self.prev_status["is_auto_managed"]:
|
||||||
|
|
1
tox.ini
1
tox.ini
|
@ -124,6 +124,7 @@ commands = flake8 --exit-zero --max-complexity 15 deluge
|
||||||
[testenv:pylint]
|
[testenv:pylint]
|
||||||
# Disable site packages to avoid using system installed version
|
# Disable site packages to avoid using system installed version
|
||||||
sitepackages = False
|
sitepackages = False
|
||||||
|
ignore_errors = True
|
||||||
deps =
|
deps =
|
||||||
{[testenv]deps}
|
{[testenv]deps}
|
||||||
pylint
|
pylint
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue