forked from LBRYCommunity/lbry-sdk
pylint fixed
This commit is contained in:
parent
310fe4a42c
commit
da8e09846d
4 changed files with 6 additions and 10 deletions
|
@ -9,7 +9,7 @@ from lbrynet.core.Error import DownloadCanceledError
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class HTTPBlobDownloader(object):
|
class HTTPBlobDownloader:
|
||||||
'''
|
'''
|
||||||
A downloader that is able to get blobs from HTTP mirrors.
|
A downloader that is able to get blobs from HTTP mirrors.
|
||||||
Note that when a blob gets downloaded from a mirror or from a peer, BlobManager will mark it as completed
|
Note that when a blob gets downloaded from a mirror or from a peer, BlobManager will mark it as completed
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# pylint: skip-file
|
||||||
from collections import defaultdict, deque
|
from collections import defaultdict, deque
|
||||||
import datetime
|
import datetime
|
||||||
import logging
|
import logging
|
||||||
|
@ -8,13 +9,6 @@ from twisted.internet import threads, reactor, defer, task
|
||||||
from twisted.python.failure import Failure
|
from twisted.python.failure import Failure
|
||||||
from twisted.internet.error import ConnectionAborted
|
from twisted.internet.error import ConnectionAborted
|
||||||
|
|
||||||
from lbryum import wallet as lbryum_wallet
|
|
||||||
from lbryum.network import Network
|
|
||||||
from lbryum.simple_config import SimpleConfig
|
|
||||||
from lbryum.constants import COIN
|
|
||||||
from lbryum.commands import Commands
|
|
||||||
from lbryum.errors import InvalidPassword
|
|
||||||
|
|
||||||
from lbryschema.uri import parse_lbry_uri
|
from lbryschema.uri import parse_lbry_uri
|
||||||
from lbryschema.claim import ClaimDict
|
from lbryschema.claim import ClaimDict
|
||||||
from lbryschema.error import DecodeError
|
from lbryschema.error import DecodeError
|
||||||
|
|
|
@ -6,6 +6,7 @@ import binascii
|
||||||
from hashlib import sha256
|
from hashlib import sha256
|
||||||
from types import SimpleNamespace
|
from types import SimpleNamespace
|
||||||
from twisted.internet import defer, threads, reactor, error
|
from twisted.internet import defer, threads, reactor, error
|
||||||
|
import lbryschema
|
||||||
from txupnp.upnp import UPnP
|
from txupnp.upnp import UPnP
|
||||||
from lbrynet import conf
|
from lbrynet import conf
|
||||||
from lbrynet.core.utils import DeferredDict
|
from lbrynet.core.utils import DeferredDict
|
||||||
|
@ -289,6 +290,7 @@ class HeadersComponent(Component):
|
||||||
if not os.path.exists(self.headers_dir):
|
if not os.path.exists(self.headers_dir):
|
||||||
os.mkdir(self.headers_dir)
|
os.mkdir(self.headers_dir)
|
||||||
if os.path.exists(self.old_file):
|
if os.path.exists(self.old_file):
|
||||||
|
log.warning("Moving old headers from %s to %s.", self.old_file, self.headers_file)
|
||||||
os.rename(self.old_file, self.headers_file)
|
os.rename(self.old_file, self.headers_file)
|
||||||
self._downloading_headers = yield self.should_download_headers_from_s3()
|
self._downloading_headers = yield self.should_download_headers_from_s3()
|
||||||
if self._downloading_headers:
|
if self._downloading_headers:
|
||||||
|
@ -334,7 +336,7 @@ class WalletComponent(Component):
|
||||||
log.info("Starting torba wallet")
|
log.info("Starting torba wallet")
|
||||||
storage = self.component_manager.get_component(DATABASE_COMPONENT)
|
storage = self.component_manager.get_component(DATABASE_COMPONENT)
|
||||||
lbryschema.BLOCKCHAIN_NAME = conf.settings['blockchain_name']
|
lbryschema.BLOCKCHAIN_NAME = conf.settings['blockchain_name']
|
||||||
self.wallet = LbryWalletManager.from_lbrynet_config(conf.settings)
|
self.wallet = LbryWalletManager.from_lbrynet_config(conf.settings, storage)
|
||||||
self.wallet.old_db = storage
|
self.wallet.old_db = storage
|
||||||
yield self.wallet.start()
|
yield self.wallet.start()
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ def sha(x: bytes) -> bytes:
|
||||||
return base58.b58encode(h)
|
return base58.b58encode(h)
|
||||||
|
|
||||||
|
|
||||||
def generate_key(x: bytes=None) -> bytes:
|
def generate_key(x: bytes = None) -> bytes:
|
||||||
if x is None:
|
if x is None:
|
||||||
return sha(os.urandom(256))
|
return sha(os.urandom(256))
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Reference in a new issue