[Lint] Cleanup code to pass PyLint Error category

Disabled:

  * no-member:
  * not-callable:
  * no-name-in-module:
This commit is contained in:
Calum Lind 2015-10-22 13:49:19 +01:00
parent 6eb46c935e
commit 3288353be0
8 changed files with 19 additions and 14 deletions

View File

@ -525,7 +525,7 @@ what is currently in the config and it could not convert the value
return self.__config_file
@prop
def config(): # pylint: disable=E0211
def config(): # pylint: disable=no-method-argument
"""The config dictionary"""
def fget(self):
return self.__config

View File

@ -50,7 +50,7 @@ class Command(BaseCommand):
self.console.write("{!green!}Plugin list successfully reloaded")
return
if options["list"]:
elif options["list"]:
def on_available_plugins(result):
self.console.write("{!info!}Available Plugins:")
for p in result:
@ -58,7 +58,7 @@ class Command(BaseCommand):
return client.core.get_available_plugins().addCallback(on_available_plugins)
if options["show"]:
elif options["show"]:
def on_enabled_plugins(result):
self.console.write("{!info!}Enabled Plugins:")
for p in result:
@ -66,7 +66,7 @@ class Command(BaseCommand):
return client.core.get_enabled_plugins().addCallback(on_enabled_plugins)
if options["enable"]:
elif options["enable"]:
def on_available_plugins(result):
plugins = {}
for p in result:
@ -79,7 +79,7 @@ class Command(BaseCommand):
return client.core.get_available_plugins().addCallback(on_available_plugins)
if options["disable"]:
elif options["disable"]:
def on_enabled_plugins(result):
plugins = {}
for p in result:
@ -92,7 +92,7 @@ class Command(BaseCommand):
return client.core.get_enabled_plugins().addCallback(on_enabled_plugins)
if options["plugin_file"]:
elif options["plugin_file"]:
filepath = options["plugin_file"]

View File

@ -166,7 +166,7 @@ def associate_magnet_links(overwrite=False):
try:
hkey = _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, "Magnet")
except WindowsError: # pylint: disable=E0602
except WindowsError: # pylint: disable=undefined-variable
overwrite = True
else:
_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")
try:
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
magnet_key = _winreg.CreateKey(_winreg.HKEY_CURRENT_USER, "Software\\Classes\\Magnet")

View File

@ -310,7 +310,7 @@ class CreateTorrentDialog:
self._on_create_torrent_progress(piece_count, num_pieces)
if piece_count == num_pieces:
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)

View File

@ -6,6 +6,7 @@
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
# pylint: disable=super-on-old-class
import gtk
from twisted.internet import defer

View File

@ -57,7 +57,7 @@ gobject.set_prgname("deluge")
log = logging.getLogger(__name__)
try:
from setproctitle import setproctitle, getproctitle # pylint: disable=E0611
from setproctitle import setproctitle, getproctitle
except ImportError:
def setproctitle(title):
return

View File

@ -438,7 +438,7 @@ class StoredValuesList(ValueList):
return True
# Add current value to saved list
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
# Edit selected value
elif is_ascii_value(keyval, 'e'):

View File

@ -31,7 +31,7 @@ unsafe-load-any-extension=no
# 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
# 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
# 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
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
#disable=all
#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,
# W1618,W1619,W1630,W1626,W1637,W1634,W1635,W1610,W1611,W1612,W1613,W1614,W1615,W1616,W1617,
# 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]