forked from LBRYCommunity/lbry-sdk
pylint fixes
fix exception formatting and a circular import
This commit is contained in:
parent
74ec4192e2
commit
a6f0c5fb4c
6 changed files with 14 additions and 10 deletions
14
.pylintrc
14
.pylintrc
|
@ -34,6 +34,8 @@ unsafe-load-any-extension=no
|
||||||
# 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=
|
extension-pkg-whitelist=
|
||||||
|
miniupnpc,
|
||||||
|
unqlite
|
||||||
|
|
||||||
# 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
|
||||||
|
@ -74,10 +76,8 @@ disable=
|
||||||
broad-except,
|
broad-except,
|
||||||
cell-var-from-loop,
|
cell-var-from-loop,
|
||||||
consider-iterating-dictionary,
|
consider-iterating-dictionary,
|
||||||
cyclic-import,
|
|
||||||
dangerous-default-value,
|
dangerous-default-value,
|
||||||
duplicate-code,
|
duplicate-code,
|
||||||
exec-used,
|
|
||||||
fixme,
|
fixme,
|
||||||
global-statement,
|
global-statement,
|
||||||
inherit-non-class,
|
inherit-non-class,
|
||||||
|
@ -86,12 +86,10 @@ disable=
|
||||||
locally-disabled,
|
locally-disabled,
|
||||||
logging-not-lazy,
|
logging-not-lazy,
|
||||||
missing-docstring,
|
missing-docstring,
|
||||||
multiple-imports,
|
|
||||||
no-else-return,
|
no-else-return,
|
||||||
no-init,
|
no-init,
|
||||||
no-member,
|
no-member,
|
||||||
no-self-use,
|
no-self-use,
|
||||||
not-context-manager,
|
|
||||||
protected-access,
|
protected-access,
|
||||||
redefined-builtin,
|
redefined-builtin,
|
||||||
redefined-outer-name,
|
redefined-outer-name,
|
||||||
|
@ -117,7 +115,13 @@ disable=
|
||||||
unused-variable,
|
unused-variable,
|
||||||
wildcard-import,
|
wildcard-import,
|
||||||
wrong-import-order,
|
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]
|
[REPORTS]
|
||||||
|
|
|
@ -52,7 +52,7 @@ class DiskBlobManager(DHTHashSupplier):
|
||||||
blob that is already on the hard disk
|
blob that is already on the hard disk
|
||||||
"""
|
"""
|
||||||
if length is not None and not isinstance(length, int):
|
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:
|
if blob_hash in self.blobs:
|
||||||
return defer.succeed(self.blobs[blob_hash])
|
return defer.succeed(self.blobs[blob_hash])
|
||||||
return self._make_new_blob(blob_hash, length)
|
return self._make_new_blob(blob_hash, length)
|
||||||
|
|
|
@ -314,7 +314,7 @@ class Daemon(AuthJSONRPCServer):
|
||||||
log.error("Couldn't bind to port %d. Visit lbry.io/faq/how-to-change-port for"
|
log.error("Couldn't bind to port %d. Visit lbry.io/faq/how-to-change-port for"
|
||||||
" more details.", self.peer_port)
|
" more details.", self.peer_port)
|
||||||
log.error("%s", traceback.format_exc())
|
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)
|
return defer.succeed(True)
|
||||||
|
|
||||||
def _start_reflector(self):
|
def _start_reflector(self):
|
||||||
|
|
|
@ -73,7 +73,7 @@ class ManagedEncryptedFileDownloader(EncryptedFileSaver):
|
||||||
self.completed = True
|
self.completed = True
|
||||||
defer.returnValue(True)
|
defer.returnValue(True)
|
||||||
else:
|
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
|
@defer.inlineCallbacks
|
||||||
def stop(self, err=None, change_status=True):
|
def stop(self, err=None, change_status=True):
|
||||||
|
|
|
@ -67,4 +67,3 @@ the client disconnects.
|
||||||
from lbrynet.reflector.server.server import ReflectorServerFactory as ServerFactory
|
from lbrynet.reflector.server.server import ReflectorServerFactory as ServerFactory
|
||||||
from lbrynet.reflector.client.client import EncryptedFileReflectorClientFactory as ClientFactory
|
from lbrynet.reflector.client.client import EncryptedFileReflectorClientFactory as ClientFactory
|
||||||
from lbrynet.reflector.client.blob import BlobReflectorClientFactory as BlobClientFactory
|
from lbrynet.reflector.client.blob import BlobReflectorClientFactory as BlobClientFactory
|
||||||
from lbrynet.reflector import reupload
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import ctypes, sys
|
import sys
|
||||||
|
import ctypes
|
||||||
from ctypes import windll, wintypes
|
from ctypes import windll, wintypes
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue