pylint fixes

fix exception formatting and a circular import
This commit is contained in:
Jack Robison 2017-12-15 20:25:20 -05:00
parent 74ec4192e2
commit a6f0c5fb4c
No known key found for this signature in database
GPG key ID: 284699E7404E3CFF
6 changed files with 14 additions and 10 deletions

View file

@ -34,6 +34,8 @@ unsafe-load-any-extension=no
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-whitelist=
miniupnpc,
unqlite
# Allow optimization of some AST trees. This will activate a peephole AST
# optimizer, which will apply various small optimizations. For instance, it can
@ -74,10 +76,8 @@ disable=
broad-except,
cell-var-from-loop,
consider-iterating-dictionary,
cyclic-import,
dangerous-default-value,
duplicate-code,
exec-used,
fixme,
global-statement,
inherit-non-class,
@ -86,12 +86,10 @@ disable=
locally-disabled,
logging-not-lazy,
missing-docstring,
multiple-imports,
no-else-return,
no-init,
no-member,
no-self-use,
not-context-manager,
protected-access,
redefined-builtin,
redefined-outer-name,
@ -117,7 +115,13 @@ disable=
unused-variable,
wildcard-import,
wrong-import-order,
wrong-import-position
wrong-import-position,
deprecated-lambda,
simplifiable-if-statement,
unidiomatic-typecheck,
global-at-module-level,
inconsistent-return-statements,
keyword-arg-before-vararg
[REPORTS]

View file

@ -52,7 +52,7 @@ class DiskBlobManager(DHTHashSupplier):
blob that is already on the hard disk
"""
if length is not None and not isinstance(length, int):
raise Exception("invalid length type: %s (%s)", length, str(type(length)))
raise Exception("invalid length type: %s (%s)" % (length, str(type(length))))
if blob_hash in self.blobs:
return defer.succeed(self.blobs[blob_hash])
return self._make_new_blob(blob_hash, length)

View file

@ -314,7 +314,7 @@ class Daemon(AuthJSONRPCServer):
log.error("Couldn't bind to port %d. Visit lbry.io/faq/how-to-change-port for"
" more details.", self.peer_port)
log.error("%s", traceback.format_exc())
raise ValueError("%s lbrynet may already be running on your computer.", str(e))
raise ValueError("%s lbrynet may already be running on your computer." % str(e))
return defer.succeed(True)
def _start_reflector(self):

View file

@ -73,7 +73,7 @@ class ManagedEncryptedFileDownloader(EncryptedFileSaver):
self.completed = True
defer.returnValue(True)
else:
raise Exception("Unknown status for stream %s: %s", self.stream_hash, status)
raise Exception("Unknown status for stream %s: %s" % (self.stream_hash, status))
@defer.inlineCallbacks
def stop(self, err=None, change_status=True):

View file

@ -67,4 +67,3 @@ the client disconnects.
from lbrynet.reflector.server.server import ReflectorServerFactory as ServerFactory
from lbrynet.reflector.client.client import EncryptedFileReflectorClientFactory as ClientFactory
from lbrynet.reflector.client.blob import BlobReflectorClientFactory as BlobClientFactory
from lbrynet.reflector import reupload

View file

@ -1,5 +1,6 @@
from __future__ import print_function
import ctypes, sys
import sys
import ctypes
from ctypes import windll, wintypes
from uuid import UUID