mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-04 15:38:43 +00:00
[Lint] Cleanup code to pass PyLint Error category
Disabled: * no-member: * not-callable: * no-name-in-module:
This commit is contained in:
parent
6eb46c935e
commit
3288353be0
8 changed files with 19 additions and 14 deletions
|
@ -525,7 +525,7 @@ what is currently in the config and it could not convert the value
|
||||||
return self.__config_file
|
return self.__config_file
|
||||||
|
|
||||||
@prop
|
@prop
|
||||||
def config(): # pylint: disable=E0211
|
def config(): # pylint: disable=no-method-argument
|
||||||
"""The config dictionary"""
|
"""The config dictionary"""
|
||||||
def fget(self):
|
def fget(self):
|
||||||
return self.__config
|
return self.__config
|
||||||
|
|
|
@ -50,7 +50,7 @@ class Command(BaseCommand):
|
||||||
self.console.write("{!green!}Plugin list successfully reloaded")
|
self.console.write("{!green!}Plugin list successfully reloaded")
|
||||||
return
|
return
|
||||||
|
|
||||||
if options["list"]:
|
elif options["list"]:
|
||||||
def on_available_plugins(result):
|
def on_available_plugins(result):
|
||||||
self.console.write("{!info!}Available Plugins:")
|
self.console.write("{!info!}Available Plugins:")
|
||||||
for p in result:
|
for p in result:
|
||||||
|
@ -58,7 +58,7 @@ class Command(BaseCommand):
|
||||||
|
|
||||||
return client.core.get_available_plugins().addCallback(on_available_plugins)
|
return client.core.get_available_plugins().addCallback(on_available_plugins)
|
||||||
|
|
||||||
if options["show"]:
|
elif options["show"]:
|
||||||
def on_enabled_plugins(result):
|
def on_enabled_plugins(result):
|
||||||
self.console.write("{!info!}Enabled Plugins:")
|
self.console.write("{!info!}Enabled Plugins:")
|
||||||
for p in result:
|
for p in result:
|
||||||
|
@ -66,7 +66,7 @@ class Command(BaseCommand):
|
||||||
|
|
||||||
return client.core.get_enabled_plugins().addCallback(on_enabled_plugins)
|
return client.core.get_enabled_plugins().addCallback(on_enabled_plugins)
|
||||||
|
|
||||||
if options["enable"]:
|
elif options["enable"]:
|
||||||
def on_available_plugins(result):
|
def on_available_plugins(result):
|
||||||
plugins = {}
|
plugins = {}
|
||||||
for p in result:
|
for p in result:
|
||||||
|
@ -79,7 +79,7 @@ class Command(BaseCommand):
|
||||||
|
|
||||||
return client.core.get_available_plugins().addCallback(on_available_plugins)
|
return client.core.get_available_plugins().addCallback(on_available_plugins)
|
||||||
|
|
||||||
if options["disable"]:
|
elif options["disable"]:
|
||||||
def on_enabled_plugins(result):
|
def on_enabled_plugins(result):
|
||||||
plugins = {}
|
plugins = {}
|
||||||
for p in result:
|
for p in result:
|
||||||
|
@ -92,7 +92,7 @@ class Command(BaseCommand):
|
||||||
|
|
||||||
return client.core.get_enabled_plugins().addCallback(on_enabled_plugins)
|
return client.core.get_enabled_plugins().addCallback(on_enabled_plugins)
|
||||||
|
|
||||||
if options["plugin_file"]:
|
elif options["plugin_file"]:
|
||||||
|
|
||||||
filepath = options["plugin_file"]
|
filepath = options["plugin_file"]
|
||||||
|
|
||||||
|
|
|
@ -166,7 +166,7 @@ def associate_magnet_links(overwrite=False):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
hkey = _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, "Magnet")
|
hkey = _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, "Magnet")
|
||||||
except WindowsError: # pylint: disable=E0602
|
except WindowsError: # pylint: disable=undefined-variable
|
||||||
overwrite = True
|
overwrite = True
|
||||||
else:
|
else:
|
||||||
_winreg.CloseKey(hkey)
|
_winreg.CloseKey(hkey)
|
||||||
|
@ -175,7 +175,7 @@ def associate_magnet_links(overwrite=False):
|
||||||
deluge_exe = os.path.join(os.path.dirname(sys.executable), "deluge.exe")
|
deluge_exe = os.path.join(os.path.dirname(sys.executable), "deluge.exe")
|
||||||
try:
|
try:
|
||||||
magnet_key = _winreg.CreateKey(_winreg.HKEY_CLASSES_ROOT, "Magnet")
|
magnet_key = _winreg.CreateKey(_winreg.HKEY_CLASSES_ROOT, "Magnet")
|
||||||
except WindowsError: # pylint: disable=E0602
|
except WindowsError: # pylint: disable=undefined-variable
|
||||||
# Could not create for all users, falling back to current user
|
# Could not create for all users, falling back to current user
|
||||||
magnet_key = _winreg.CreateKey(_winreg.HKEY_CURRENT_USER, "Software\\Classes\\Magnet")
|
magnet_key = _winreg.CreateKey(_winreg.HKEY_CURRENT_USER, "Software\\Classes\\Magnet")
|
||||||
|
|
||||||
|
|
|
@ -310,7 +310,7 @@ class CreateTorrentDialog:
|
||||||
self._on_create_torrent_progress(piece_count, num_pieces)
|
self._on_create_torrent_progress(piece_count, num_pieces)
|
||||||
if piece_count == num_pieces:
|
if piece_count == num_pieces:
|
||||||
from twisted.internet import reactor
|
from twisted.internet import reactor
|
||||||
reactor.callLater(0.5, torrent_created) # pylint: disable=E1101
|
reactor.callLater(0.5, torrent_created)
|
||||||
|
|
||||||
client.register_event_handler("CreateTorrentProgressEvent", on_create_torrent_progress_event)
|
client.register_event_handler("CreateTorrentProgressEvent", on_create_torrent_progress_event)
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
# the additional special exception to link portions of this program with the OpenSSL library.
|
# the additional special exception to link portions of this program with the OpenSSL library.
|
||||||
# See LICENSE for more details.
|
# See LICENSE for more details.
|
||||||
#
|
#
|
||||||
|
# pylint: disable=super-on-old-class
|
||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
|
@ -57,7 +57,7 @@ gobject.set_prgname("deluge")
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from setproctitle import setproctitle, getproctitle # pylint: disable=E0611
|
from setproctitle import setproctitle, getproctitle
|
||||||
except ImportError:
|
except ImportError:
|
||||||
def setproctitle(title):
|
def setproctitle(title):
|
||||||
return
|
return
|
||||||
|
|
|
@ -438,7 +438,7 @@ class StoredValuesList(ValueList):
|
||||||
return True
|
return True
|
||||||
# Add current value to saved list
|
# Add current value to saved list
|
||||||
elif is_ascii_value(keyval, 's'):
|
elif is_ascii_value(keyval, 's'):
|
||||||
super(PathChooserComboBox, self).add_current_value_to_saved_list()
|
super(PathChooserComboBox, self).add_current_value_to_saved_list() # pylint: disable=bad-super-call
|
||||||
return True
|
return True
|
||||||
# Edit selected value
|
# Edit selected value
|
||||||
elif is_ascii_value(keyval, 'e'):
|
elif is_ascii_value(keyval, 'e'):
|
||||||
|
|
10
pylintrc
10
pylintrc
|
@ -31,7 +31,7 @@ unsafe-load-any-extension=no
|
||||||
# A comma-separated list of package or module names from where C extensions may
|
# A comma-separated list of package or module names from where C extensions may
|
||||||
# be loaded. Extensions are loading into the active Python interpreter and may
|
# be loaded. Extensions are loading into the active Python interpreter and may
|
||||||
# run arbitrary code
|
# run arbitrary code
|
||||||
extension-pkg-whitelist=libtorrent,gtk,gobject,gnome,twisted,wnck
|
extension-pkg-whitelist=
|
||||||
|
|
||||||
# Allow optimization of some AST trees. This will activate a peephole AST
|
# Allow optimization of some AST trees. This will activate a peephole AST
|
||||||
# optimizer, which will apply various small optimizations. For instance, it can
|
# optimizer, which will apply various small optimizations. For instance, it can
|
||||||
|
@ -62,12 +62,16 @@ confidence=
|
||||||
# --enable=similarities". If you want to run only the classes checker, but have
|
# --enable=similarities". If you want to run only the classes checker, but have
|
||||||
# no Warning level messages displayed, use"--disable=all --enable=classes
|
# no Warning level messages displayed, use"--disable=all --enable=classes
|
||||||
# --disable=W"
|
# --disable=W"
|
||||||
#disable=all
|
|
||||||
#disable=E1608,W1627,E1601,E1603,E1602,E1605,E1604,E1607,E1606,W1621,W1620,W1623,W1622,W1625,
|
#disable=E1608,W1627,E1601,E1603,E1602,E1605,E1604,E1607,E1606,W1621,W1620,W1623,W1622,W1625,
|
||||||
# W1624,W1609,W1608,W1607,W1606,W1605,W1604,W1603,W1602,W1601,W1639,W1640,I0021,W1638,I0020,
|
# W1624,W1609,W1608,W1607,W1606,W1605,W1604,W1603,W1602,W1601,W1639,W1640,I0021,W1638,I0020,
|
||||||
# W1618,W1619,W1630,W1626,W1637,W1634,W1635,W1610,W1611,W1612,W1613,W1614,W1615,W1616,W1617,
|
# W1618,W1619,W1630,W1626,W1637,W1634,W1635,W1610,W1611,W1612,W1613,W1614,W1615,W1616,W1617,
|
||||||
# W1632,W1633,W0704,W1628,W1629,W1636
|
# W1632,W1633,W0704,W1628,W1629,W1636
|
||||||
disable=E1101,E1102,no-name-in-module,W,C,R,locally-disabled,
|
disable=C,
|
||||||
|
no-member, not-callable, no-name-in-module,
|
||||||
|
W,
|
||||||
|
R,
|
||||||
|
locally-disabled
|
||||||
|
|
||||||
|
|
||||||
[REPORTS]
|
[REPORTS]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue