absolute imports

This commit is contained in:
Jack Robison 2018-11-09 14:02:03 -05:00
parent 1b4230b06e
commit d704336f20
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
52 changed files with 139 additions and 154 deletions

View file

@ -1,4 +0,0 @@
from .blob_file import BlobFile
from .creator import BlobFileCreator
from .writer import HashBlobWriter
from .reader import HashBlobReader

View file

@ -10,7 +10,6 @@ from lbrynet.p2p.client.StreamProgressManager import FullStreamProgressManager
from lbrynet.blob.client.CryptBlobHandler import CryptBlobHandler from lbrynet.blob.client.CryptBlobHandler import CryptBlobHandler
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -15,7 +15,7 @@ from lbrynet.androidhelpers.paths import (
) )
try: try:
from .winpaths import get_path, FOLDERID, UserHandle from lbrynet.winpaths import get_path, FOLDERID, UserHandle
except (ImportError, ValueError, NameError): except (ImportError, ValueError, NameError):
# Android platform: NameError: name 'c_wchar' is not defined # Android platform: NameError: name 'c_wchar' is not defined
pass pass

View file

@ -1,7 +1,7 @@
import ipaddress import ipaddress
from binascii import hexlify from binascii import hexlify
from functools import reduce from functools import reduce
from . import constants from lbrynet.dht import constants
def is_valid_ipv4(address): def is_valid_ipv4(address):

View file

@ -1,5 +1,5 @@
from collections import UserDict from collections import UserDict
from . import constants from lbrynet.dht import constants
class DictDataStore(UserDict): class DictDataStore(UserDict):

View file

@ -1,4 +1,4 @@
from . import constants from lbrynet.dht import constants
class Distance: class Distance:

View file

@ -1,4 +1,4 @@
from .error import DecodeError from lbrynet.dht.error import DecodeError
def bencode(data): def bencode(data):

View file

@ -1,8 +1,8 @@
import logging import logging
from twisted.internet import defer from twisted.internet import defer
from .distance import Distance from lbrynet.dht.distance import Distance
from .error import TimeoutError from lbrynet.dht.error import TimeoutError
from . import constants from lbrynet.dht import constants
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -1,8 +1,8 @@
import logging import logging
from . import constants from lbrynet.dht import constants
from .distance import Distance from lbrynet.dht.distance import Distance
from .error import BucketFull from lbrynet.dht.error import BucketFull
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -7,7 +7,7 @@
# The docstrings in this module contain epytext markup; API documentation # The docstrings in this module contain epytext markup; API documentation
# may be created by processing this file with epydoc: http://epydoc.sf.net # may be created by processing this file with epydoc: http://epydoc.sf.net
from . import msgtypes from lbrynet.dht import msgtypes
class MessageTranslator: class MessageTranslator:

View file

@ -8,7 +8,7 @@
# may be created by processing this file with epydoc: http://epydoc.sf.net # may be created by processing this file with epydoc: http://epydoc.sf.net
from lbrynet.utils import generate_id from lbrynet.utils import generate_id
from . import constants from lbrynet.dht import constants
class Message: class Message:

View file

@ -6,14 +6,11 @@ from functools import reduce
from twisted.internet import defer, error, task from twisted.internet import defer, error, task
from lbrynet.utils import generate_id, DeferredDict from lbrynet.utils import generate_id, DeferredDict
from .call_later_manager import CallLaterManager from lbrynet.dht.call_later_manager import CallLaterManager
from .error import TimeoutError from lbrynet.dht.error import TimeoutError
from . import constants from lbrynet.dht import constants, routingtable, datastore, protocol
from . import routingtable from lbrynet.dht.contact import ContactManager
from . import datastore from lbrynet.dht.iterativefind import iterativeFind
from . import protocol
from .contact import ContactManager
from .iterativefind import iterativeFind
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -3,12 +3,8 @@ import errno
from binascii import hexlify from binascii import hexlify
from twisted.internet import protocol, defer from twisted.internet import protocol, defer
from .error import BUILTIN_EXCEPTIONS, UnknownRemoteException, TimeoutError, TransportNotConnected from lbrynet.dht import constants, encoding, msgformat, msgtypes
from lbrynet.dht.error import BUILTIN_EXCEPTIONS, UnknownRemoteException, TimeoutError, TransportNotConnected
from . import constants
from . import encoding
from . import msgtypes
from . import msgformat
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -6,14 +6,13 @@
# may be created by processing this file with epydoc: http://epydoc.sf.net # may be created by processing this file with epydoc: http://epydoc.sf.net
import random import random
from binascii import unhexlify
from twisted.internet import defer
from . import constants
from . import kbucket
from .error import TimeoutError
from .distance import Distance
import logging import logging
from binascii import unhexlify
from twisted.internet import defer
from lbrynet.dht import constants, kbucket
from lbrynet.dht.error import TimeoutError
from lbrynet.dht.distance import Distance
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -1,7 +1,7 @@
import logging import logging
from twisted.internet import defer from twisted.internet import defer
from twisted._threads import AlreadyQuit from twisted._threads import AlreadyQuit
from .ComponentManager import ComponentManager from lbrynet.extras.daemon.ComponentManager import ComponentManager
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -1,8 +1,8 @@
import logging import logging
from twisted.internet import defer from twisted.internet import defer
from lbrynet.p2p.Error import ComponentStartConditionNotMet from lbrynet.p2p.Error import ComponentStartConditionNotMet
from .PeerManager import PeerManager from lbrynet.extras.daemon.PeerManager import PeerManager
from .PeerFinder import DHTPeerFinder from lbrynet.extras.daemon.PeerFinder import DHTPeerFinder
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -8,30 +8,33 @@ 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, task from twisted.internet import defer, threads, reactor, error, task
import lbrynet.schema
from aioupnp import __version__ as aioupnp_version from aioupnp import __version__ as aioupnp_version
from aioupnp.upnp import UPnP from aioupnp.upnp import UPnP
from aioupnp.fault import UPnPError from aioupnp.fault import UPnPError
import lbrynet.schema
from lbrynet import conf from lbrynet import conf
from lbrynet.blob.EncryptedFileManager import EncryptedFileManager
from lbrynet.blob.client.EncryptedFileDownloader import EncryptedFileSaverFactory
from lbrynet.blob.client.EncryptedFileOptions import add_lbry_file_to_sd_identifier
from lbrynet.dht.node import Node
from lbrynet.extras.daemon.Component import Component
from lbrynet.extras.daemon.ExchangeRateManager import ExchangeRateManager
from lbrynet.extras.daemon.storage import SQLiteStorage
from lbrynet.extras.daemon.HashAnnouncer import DHTHashAnnouncer
from lbrynet.extras.reflector.server.server import ReflectorServerFactory
from lbrynet.extras.wallet import LbryWalletManager
from lbrynet.extras.wallet import Network
from lbrynet.utils import DeferredDict, generate_id from lbrynet.utils import DeferredDict, generate_id
from lbrynet.p2p.PaymentRateManager import OnlyFreePaymentsManager from lbrynet.p2p.PaymentRateManager import OnlyFreePaymentsManager
from lbrynet.p2p.RateLimiter import RateLimiter from lbrynet.p2p.RateLimiter import RateLimiter
from lbrynet.p2p.BlobManager import DiskBlobManager from lbrynet.p2p.BlobManager import DiskBlobManager
from lbrynet.p2p.StreamDescriptor import StreamDescriptorIdentifier, EncryptedFileStreamType from lbrynet.p2p.StreamDescriptor import StreamDescriptorIdentifier, EncryptedFileStreamType
from lbrynet.extras.wallet import LbryWalletManager
from lbrynet.extras.wallet import Network
from lbrynet.p2p.server.BlobRequestHandler import BlobRequestHandlerFactory from lbrynet.p2p.server.BlobRequestHandler import BlobRequestHandlerFactory
from lbrynet.p2p.server.ServerProtocol import ServerProtocolFactory from lbrynet.p2p.server.ServerProtocol import ServerProtocolFactory
from .Component import Component
from .ExchangeRateManager import ExchangeRateManager
from .storage import SQLiteStorage
from .HashAnnouncer import DHTHashAnnouncer
from lbrynet.dht.node import Node
from lbrynet.blob.EncryptedFileManager import EncryptedFileManager
from lbrynet.blob.client.EncryptedFileDownloader import EncryptedFileSaverFactory
from lbrynet.blob.client.EncryptedFileOptions import add_lbry_file_to_sd_identifier
from lbrynet.extras.reflector import ServerFactory as reflector_server_factory
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -649,7 +652,7 @@ class ReflectorComponent(Component):
log.info("Starting reflector server") log.info("Starting reflector server")
blob_manager = self.component_manager.get_component(BLOB_COMPONENT) blob_manager = self.component_manager.get_component(BLOB_COMPONENT)
file_manager = self.component_manager.get_component(FILE_MANAGER_COMPONENT) file_manager = self.component_manager.get_component(FILE_MANAGER_COMPONENT)
reflector_factory = reflector_server_factory(self.component_manager.peer_manager, blob_manager, file_manager) reflector_factory = ReflectorServerFactory(self.component_manager.peer_manager, blob_manager, file_manager)
try: try:
self.reflector_server = yield reactor.listenTCP(self.reflector_server_port, reflector_factory) self.reflector_server = yield reactor.listenTCP(self.reflector_server_port, reflector_factory)
log.info('Started reflector on port %s', self.reflector_server_port) log.info('Started reflector on port %s', self.reflector_server_port)

View file

@ -17,7 +17,26 @@ from twisted.python.failure import Failure
from torba.client.baseaccount import SingleKey, HierarchicalDeterministic from torba.client.baseaccount import SingleKey, HierarchicalDeterministic
from lbrynet import conf, utils, __version__ from lbrynet import conf, utils, __version__
from lbrynet.dht.error import TimeoutError
from lbrynet.extras import system_info from lbrynet.extras import system_info
from lbrynet.extras.reflector import reupload
from lbrynet.extras.daemon.Components import d2f, f2d
from lbrynet.extras.daemon.Components import WALLET_COMPONENT, DATABASE_COMPONENT, DHT_COMPONENT, BLOB_COMPONENT
from lbrynet.extras.daemon.Components import FILE_MANAGER_COMPONENT, RATE_LIMITER_COMPONENT
from lbrynet.extras.daemon.Components import EXCHANGE_RATE_MANAGER_COMPONENT, PAYMENT_RATE_COMPONENT, UPNP_COMPONENT
from lbrynet.extras.daemon.ComponentManager import RequiredCondition
from lbrynet.extras.daemon.Downloader import GetStream
from lbrynet.extras.daemon.Publisher import Publisher
from lbrynet.extras.daemon.auth.server import AuthJSONRPCServer
from lbrynet.extras.wallet import LbryWalletManager
from lbrynet.extras.wallet.account import Account as LBCAccount
from lbrynet.extras.wallet.dewies import dewies_to_lbc, lbc_to_dewies
from lbrynet.p2p.StreamDescriptor import download_sd_blob
from lbrynet.p2p.Error import InsufficientFundsError, UnknownNameError, DownloadDataTimeout, DownloadSDTimeout
from lbrynet.p2p.Error import NullFundsError, NegativeFundsError, ResolveError
from lbrynet.p2p.Peer import Peer
from lbrynet.p2p.SinglePeerDownloader import SinglePeerDownloader
from lbrynet.p2p.client.StandaloneBlobDownloader import StandaloneBlobDownloader
from lbrynet.schema.claim import ClaimDict from lbrynet.schema.claim import ClaimDict
from lbrynet.schema.uri import parse_lbry_uri from lbrynet.schema.uri import parse_lbry_uri
from lbrynet.schema.error import URIParseError, DecodeError from lbrynet.schema.error import URIParseError, DecodeError
@ -25,28 +44,6 @@ from lbrynet.schema.validator import validate_claim_id
from lbrynet.schema.address import decode_address from lbrynet.schema.address import decode_address
from lbrynet.schema.decode import smart_decode from lbrynet.schema.decode import smart_decode
from lbrynet.extras.reflector import reupload
from .Components import d2f, f2d
from .Components import WALLET_COMPONENT, DATABASE_COMPONENT, DHT_COMPONENT, BLOB_COMPONENT
from .Components import FILE_MANAGER_COMPONENT, RATE_LIMITER_COMPONENT
from .Components import EXCHANGE_RATE_MANAGER_COMPONENT, PAYMENT_RATE_COMPONENT, UPNP_COMPONENT
from .ComponentManager import RequiredCondition
from .Downloader import GetStream
from .Publisher import Publisher
from .auth.server import AuthJSONRPCServer
from lbrynet.p2p.StreamDescriptor import download_sd_blob
from lbrynet.p2p.Error import InsufficientFundsError, UnknownNameError
from lbrynet.p2p.Error import DownloadDataTimeout, DownloadSDTimeout
from lbrynet.p2p.Error import NullFundsError, NegativeFundsError
from lbrynet.p2p.Error import ResolveError
from lbrynet.dht.error import TimeoutError
from lbrynet.p2p.Peer import Peer
from lbrynet.p2p.SinglePeerDownloader import SinglePeerDownloader
from lbrynet.p2p.client.StandaloneBlobDownloader import StandaloneBlobDownloader
from lbrynet.extras.wallet import LbryWalletManager
from lbrynet.extras.wallet.account import Account as LBCAccount
from lbrynet.extras.wallet.dewies import dewies_to_lbc, lbc_to_dewies
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
requires = AuthJSONRPCServer.requires requires = AuthJSONRPCServer.requires

View file

@ -6,11 +6,10 @@ import logging.handlers
from twisted.internet import defer, reactor, threads from twisted.internet import defer, reactor, threads
from aiohttp import client_exceptions from aiohttp import client_exceptions
from lbrynet import utils, conf, log_support
from lbrynet.extras.daemon import analytics from lbrynet.extras.daemon import analytics
from lbrynet import utils, conf from lbrynet.extras.daemon.auth.client import LBRYAPIClient
from lbrynet import log_support from lbrynet.extras.daemon.Daemon import Daemon
from .auth.client import LBRYAPIClient
from .Daemon import Daemon
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -14,7 +14,7 @@ import logging.handlers
from twisted.internet import reactor from twisted.internet import reactor
from lbrynet import utils, conf, log_support from lbrynet import utils, conf, log_support
from lbrynet.extras import system_info from lbrynet.extras import system_info
from .Daemon import Daemon from lbrynet.extras.daemon.Daemon import Daemon
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -3,7 +3,6 @@ import os
from twisted.internet import defer from twisted.internet import defer
from twisted.internet.task import LoopingCall from twisted.internet.task import LoopingCall
from .Components import f2d
from lbrynet import conf from lbrynet import conf
from lbrynet.schema.fee import Fee from lbrynet.schema.fee import Fee
@ -14,6 +13,7 @@ from lbrynet.p2p.StreamDescriptor import download_sd_blob
from lbrynet.blob.EncryptedFileDownloader import ManagedEncryptedFileDownloaderFactory from lbrynet.blob.EncryptedFileDownloader import ManagedEncryptedFileDownloaderFactory
from torba.client.constants import COIN from torba.client.constants import COIN
from lbrynet.extras.wallet.dewies import dewies_to_lbc from lbrynet.extras.wallet.dewies import dewies_to_lbc
from lbrynet.extras.daemon.Components import f2d
INITIALIZING_CODE = 'initializing' INITIALIZING_CODE = 'initializing'
DOWNLOAD_METADATA_CODE = 'downloading_metadata' DOWNLOAD_METADATA_CODE = 'downloading_metadata'

View file

@ -1 +1 @@
from . import Components # register Component classes from lbrynet.extras.daemon import Components # register Component classes

View file

@ -3,7 +3,7 @@ from zope.interface import implementer
from twisted.cred import portal, checkers, credentials, error as cred_error from twisted.cred import portal, checkers, credentials, error as cred_error
from twisted.internet import defer from twisted.internet import defer
from twisted.web import resource from twisted.web import resource
from .keyring import Keyring from lbrynet.extras.daemon.auth.keyring import Keyring
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -4,7 +4,7 @@ import logging
from urllib.parse import urlparse from urllib.parse import urlparse
from lbrynet import conf from lbrynet import conf
from .keyring import Keyring, APIKey from lbrynet.extras.daemon.auth.keyring import Keyring, APIKey
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
USER_AGENT = "AuthServiceProxy/0.1" USER_AGENT = "AuthServiceProxy/0.1"

View file

@ -4,8 +4,8 @@ from twisted.web import server, guard, resource
from twisted.cred import portal from twisted.cred import portal
from lbrynet import conf from lbrynet import conf
from .auth import PasswordChecker, HttpPasswordRealm from lbrynet.extras.daemon.auth.auth import PasswordChecker, HttpPasswordRealm
from ..auth.keyring import Keyring from lbrynet.extras.daemon.auth.keyring import Keyring
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -3,6 +3,7 @@ import datetime
import hmac import hmac
import hashlib import hashlib
import base58 import base58
import logging
from OpenSSL.crypto import FILETYPE_PEM from OpenSSL.crypto import FILETYPE_PEM
from ssl import create_default_context, SSLContext from ssl import create_default_context, SSLContext
from cryptography.hazmat.backends import default_backend from cryptography.hazmat.backends import default_backend
@ -12,7 +13,7 @@ from cryptography.x509.name import NameOID, NameAttribute
from cryptography.hazmat.primitives.asymmetric import rsa from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives import serialization
from twisted.internet import ssl from twisted.internet import ssl
import logging
from lbrynet import conf from lbrynet import conf
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -4,7 +4,6 @@ from six.moves.urllib import parse as urlparse
import json import json
import inspect import inspect
import signal import signal
from functools import wraps from functools import wraps
from twisted.web import server from twisted.web import server
from twisted.internet import defer from twisted.internet import defer
@ -13,16 +12,18 @@ from twisted.python.failure import Failure
from twisted.internet.error import ConnectionDone, ConnectionLost from twisted.internet.error import ConnectionDone, ConnectionLost
from txjsonrpc import jsonrpclib from txjsonrpc import jsonrpclib
from traceback import format_exc from traceback import format_exc
from lbrynet import conf, utils from lbrynet import conf, utils
from lbrynet.extras.daemon import analytics from lbrynet.extras.daemon import analytics
from lbrynet.p2p.Error import InvalidAuthenticationToken from lbrynet.p2p.Error import InvalidAuthenticationToken
from lbrynet.p2p.Error import ComponentsNotStarted, ComponentStartConditionNotMet from lbrynet.p2p.Error import ComponentsNotStarted, ComponentStartConditionNotMet
from lbrynet.extras.looping_call_manager import LoopingCallManager from lbrynet.extras.looping_call_manager import LoopingCallManager
from lbrynet.extras.daemon.ComponentManager import ComponentManager from lbrynet.extras.daemon.ComponentManager import ComponentManager
from .keyring import APIKey, Keyring from lbrynet.extras.daemon.auth.keyring import APIKey, Keyring
from .undecorated import undecorated from lbrynet.extras.daemon.auth.undecorated import undecorated
from .factory import AuthJSONRPCResource from lbrynet.extras.daemon.auth.factory import AuthJSONRPCResource
from lbrynet.extras.daemon.json_response_encoder import JSONResponseEncoder from lbrynet.extras.daemon.json_response_encoder import JSONResponseEncoder
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
EMPTY_PARAMS = [{}] EMPTY_PARAMS = [{}]

View file

@ -2,8 +2,8 @@ import sqlite3
import os import os
import json import json
import logging import logging
from lbrynet.schema.decode import smart_decode
from lbrynet import conf from lbrynet import conf
from lbrynet.schema.decode import smart_decode
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -6,12 +6,13 @@ from binascii import hexlify, unhexlify
from decimal import Decimal from decimal import Decimal
from twisted.internet import defer, task, threads from twisted.internet import defer, task, threads
from twisted.enterprise import adbapi from twisted.enterprise import adbapi
from torba.client.constants import COIN
from lbrynet import conf from lbrynet import conf
from lbrynet.schema.claim import ClaimDict from lbrynet.schema.claim import ClaimDict
from lbrynet.schema.decode import smart_decode from lbrynet.schema.decode import smart_decode
from lbrynet.blob.CryptBlob import CryptBlobInfo from lbrynet.blob.CryptBlob import CryptBlobInfo
from lbrynet.dht.constants import dataExpireTimeout from lbrynet.dht.constants import dataExpireTimeout
from torba.client.constants import COIN
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -63,6 +63,3 @@ If the transfer was not successful (False), the blob is re-added to the needed_b
Blob requests continue for each of the blobs the client has queued to send, when completed Blob requests continue for each of the blobs the client has queued to send, when completed
the client disconnects. the client disconnects.
""" """
from .server.server import ReflectorServerFactory as ServerFactory
from .client.client import EncryptedFileReflectorClientFactory as ClientFactory
from .client.blob import BlobReflectorClientFactory as BlobClientFactory

View file

@ -2,7 +2,8 @@ import random
from twisted.internet import reactor, defer from twisted.internet import reactor, defer
from lbrynet import conf from lbrynet import conf
from . import ClientFactory, BlobClientFactory from lbrynet.extras.reflector.client.client import EncryptedFileReflectorClientFactory
from lbrynet.extras.reflector.client.blob import BlobReflectorClientFactory
def _is_ip(host): def _is_ip(host):
@ -26,7 +27,7 @@ def resolve(host):
@defer.inlineCallbacks @defer.inlineCallbacks
def _reflect_stream(blob_manager, stream_hash, sd_hash, reflector_server): def _reflect_stream(blob_manager, stream_hash, sd_hash, reflector_server):
reflector_address, reflector_port = reflector_server[0], reflector_server[1] reflector_address, reflector_port = reflector_server[0], reflector_server[1]
factory = ClientFactory(blob_manager, stream_hash, sd_hash) factory = EncryptedFileReflectorClientFactory(blob_manager, stream_hash, sd_hash)
ip = yield resolve(reflector_address) ip = yield resolve(reflector_address)
yield reactor.connectTCP(ip, reflector_port, factory) yield reactor.connectTCP(ip, reflector_port, factory)
result = yield factory.finished_deferred result = yield factory.finished_deferred
@ -40,7 +41,7 @@ def _reflect_file(lbry_file, reflector_server):
@defer.inlineCallbacks @defer.inlineCallbacks
def _reflect_blobs(blob_manager, blob_hashes, reflector_server): def _reflect_blobs(blob_manager, blob_hashes, reflector_server):
reflector_address, reflector_port = reflector_server[0], reflector_server[1] reflector_address, reflector_port = reflector_server[0], reflector_server[1]
factory = BlobClientFactory(blob_manager, blob_hashes) factory = BlobReflectorClientFactory(blob_manager, blob_hashes)
ip = yield resolve(reflector_address) ip = yield resolve(reflector_address)
yield reactor.connectTCP(ip, reflector_port, factory) yield reactor.connectTCP(ip, reflector_port, factory)
result = yield factory.finished_deferred result = yield factory.finished_deferred

View file

@ -1,9 +1,9 @@
import platform import platform
import os import os
import logging.handlers
from lbrynet.schema import __version__ as schema_version from lbrynet.schema import __version__ as schema_version
from lbrynet import build_type, __version__ as lbrynet_version from lbrynet import build_type, __version__ as lbrynet_version
import logging.handlers
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -6,6 +6,6 @@ __node_url__ = (
) )
__spvserver__ = 'lbrynet.extras.wallet.server.coin.LBCRegTest' __spvserver__ = 'lbrynet.extras.wallet.server.coin.LBCRegTest'
from .ledger import MainNetLedger, RegTestLedger from lbrynet.extras.wallet.ledger import MainNetLedger, RegTestLedger
from .manager import LbryWalletManager from lbrynet.extras.wallet.manager import LbryWalletManager
from .network import Network from lbrynet.extras.wallet.network import Network

View file

@ -2,17 +2,16 @@ import asyncio
import logging import logging
from binascii import unhexlify from binascii import unhexlify
from lbrynet.extras.wallet.dewies import dewies_to_lbc from torba.client.baseledger import BaseLedger
from lbrynet.schema.error import URIParseError from lbrynet.schema.error import URIParseError
from lbrynet.schema.uri import parse_lbry_uri from lbrynet.schema.uri import parse_lbry_uri
from torba.client.baseledger import BaseLedger from lbrynet.extras.wallet.dewies import dewies_to_lbc
from lbrynet.extras.wallet.resolve import Resolver
from .resolve import Resolver from lbrynet.extras.wallet.account import Account
from .account import Account from lbrynet.extras.wallet.network import Network
from .network import Network from lbrynet.extras.wallet.database import WalletDatabase
from .database import WalletDatabase from lbrynet.extras.wallet.transaction import Transaction
from .transaction import Transaction from lbrynet.extras.wallet.header import Headers, UnvalidatedHeaders
from .header import Headers, UnvalidatedHeaders
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -14,11 +14,11 @@ from torba.client.basemanager import BaseWalletManager
from lbrynet.schema.claim import ClaimDict from lbrynet.schema.claim import ClaimDict
from .ledger import MainNetLedger from lbrynet.extras.wallet.ledger import MainNetLedger
from .account import BaseAccount, generate_certificate from lbrynet.extras.wallet.account import BaseAccount, generate_certificate
from .transaction import Transaction from lbrynet.extras.wallet.transaction import Transaction
from .database import WalletDatabase from lbrynet.extras.wallet.database import WalletDatabase
from .dewies import dewies_to_lbc from lbrynet.extras.wallet.dewies import dewies_to_lbc
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -9,8 +9,7 @@ from lbrynet.schema.claim import ClaimDict
from lbrynet.schema.decode import smart_decode from lbrynet.schema.decode import smart_decode
from lbrynet.schema.error import DecodeError from lbrynet.schema.error import DecodeError
from lbrynet.schema.uri import parse_lbry_uri from lbrynet.schema.uri import parse_lbry_uri
from lbrynet.extras.wallet.claim_proofs import verify_proof, InvalidProofError
from .claim_proofs import verify_proof, InvalidProofError
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -9,7 +9,7 @@ from lbrynet.schema.proto.claim_pb2 import Claim
from lbrynet.schema.uri import parse_lbry_uri from lbrynet.schema.uri import parse_lbry_uri
from lbrynet.schema.decode import smart_decode from lbrynet.schema.decode import smart_decode
from .model import NameClaim, ClaimInfo, ClaimUpdate, ClaimSupport from lbrynet.extras.wallet.server.model import NameClaim, ClaimInfo, ClaimUpdate, ClaimSupport
class LBRYBlockProcessor(BlockProcessor): class LBRYBlockProcessor(BlockProcessor):

View file

@ -6,7 +6,7 @@ from torba.server.hash import hash_to_hex_str, HASHX_LEN
from hashlib import sha256 from hashlib import sha256
from torba.server.coins import Coin, CoinError from torba.server.coins import Coin, CoinError
from .opcodes import decode_claim_script, opcodes as lbry_opcodes from lbrynet.extras.wallet.server.opcodes import decode_claim_script, opcodes as lbry_opcodes
class LBC(Coin): class LBC(Coin):

View file

@ -6,7 +6,7 @@ from torba.server.hash import hash_to_hex_str
from torba.server.db import DB from torba.server.db import DB
from .model import ClaimInfo from lbrynet.extras.wallet.server.model import ClaimInfo
class LBRYDB(DB): class LBRYDB(DB):

View file

@ -1,6 +1,6 @@
import struct import struct
from torba.server.enum import Enumeration from torba.server.enum import Enumeration
from .model import NameClaim, ClaimSupport, ClaimUpdate from lbrynet.extras.wallet.server.model import NameClaim, ClaimSupport, ClaimUpdate
# TODO: Take this to lbryschema (it's also on lbryum and lbryum-server) # TODO: Take this to lbryschema (it's also on lbryum and lbryum-server)

View file

@ -8,8 +8,8 @@ from torba.server import util
from lbrynet.schema.uri import parse_lbry_uri from lbrynet.schema.uri import parse_lbry_uri
from lbrynet.schema.error import URIParseError from lbrynet.schema.error import URIParseError
from .block_processor import LBRYBlockProcessor from lbrynet.extras.wallet.server.block_processor import LBRYBlockProcessor
from .db import LBRYDB from lbrynet.extras.wallet.server.db import LBRYDB
class LBRYElectrumX(ElectrumX): class LBRYElectrumX(ElectrumX):

View file

@ -1,6 +1,6 @@
from torba.server.tx import Deserializer from torba.server.tx import Deserializer
from .opcodes import decode_claim_script from lbrynet.extras.wallet.server.opcodes import decode_claim_script
from .model import TxClaimOutput, LBRYTx from lbrynet.extras.wallet.server.model import TxClaimOutput, LBRYTx
class LBRYDeserializer(Deserializer): class LBRYDeserializer(Deserializer):

View file

@ -2,13 +2,12 @@ import struct
from binascii import hexlify, unhexlify from binascii import hexlify, unhexlify
from typing import List, Iterable, Optional from typing import List, Iterable, Optional
from lbrynet.schema.decode import smart_decode
from .account import Account
from torba.client.basetransaction import BaseTransaction, BaseInput, BaseOutput from torba.client.basetransaction import BaseTransaction, BaseInput, BaseOutput
from torba.client.hash import hash160 from torba.client.hash import hash160
from lbrynet.schema.decode import smart_decode
from lbrynet.schema.claim import ClaimDict from lbrynet.schema.claim import ClaimDict
from .script import InputScript, OutputScript from lbrynet.extras.wallet.account import Account
from lbrynet.extras.wallet.script import InputScript, OutputScript
class Input(BaseInput): class Input(BaseInput):

View file

@ -1,10 +1,9 @@
import logging import logging
import random import random
import time import time
from decimal import Decimal
from twisted.internet import defer from twisted.internet import defer
from twisted.internet.task import LoopingCall from twisted.internet.task import LoopingCall
from decimal import Decimal
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -1,9 +1,10 @@
from random import choice
import logging import logging
import treq
from random import choice
from twisted.internet import defer, task from twisted.internet import defer, task
from twisted.internet.error import ConnectingCancelledError from twisted.internet.error import ConnectingCancelledError
from twisted.web._newclient import ResponseNeverReceived from twisted.web._newclient import ResponseNeverReceived
import treq
from lbrynet.utils import DeferredDict from lbrynet.utils import DeferredDict
from lbrynet.p2p.Error import DownloadCanceledError from lbrynet.p2p.Error import DownloadCanceledError

View file

@ -1,6 +1,6 @@
from lbrynet.p2p.Strategy import get_default_strategy, OnlyFreeStrategy
from lbrynet import conf
from decimal import Decimal from decimal import Decimal
from lbrynet import conf
from lbrynet.p2p.Strategy import get_default_strategy, OnlyFreeStrategy
class BasePaymentRateManager: class BasePaymentRateManager:

View file

@ -4,7 +4,7 @@ import tempfile
from twisted.internet import defer, threads, reactor from twisted.internet import defer, threads, reactor
from lbrynet.blob import BlobFile from lbrynet.blob.blob_file import BlobFile
from lbrynet.p2p.BlobManager import DiskBlobManager from lbrynet.p2p.BlobManager import DiskBlobManager
from lbrynet.p2p.RateLimiter import DummyRateLimiter from lbrynet.p2p.RateLimiter import DummyRateLimiter
from lbrynet.p2p.PaymentRateManager import OnlyFreePaymentsManager from lbrynet.p2p.PaymentRateManager import OnlyFreePaymentsManager

View file

@ -1,10 +1,10 @@
from binascii import unhexlify
import string import string
from collections import defaultdict
import json import json
import logging import logging
from collections import defaultdict
from binascii import unhexlify
from twisted.internet import threads, defer from twisted.internet import threads, defer
from lbrynet.cryptoutils import get_lbry_hash_obj from lbrynet.cryptoutils import get_lbry_hash_obj
from lbrynet.p2p.client.StandaloneBlobDownloader import StandaloneBlobDownloader from lbrynet.p2p.client.StandaloneBlobDownloader import StandaloneBlobDownloader
from lbrynet.p2p.Error import UnknownStreamTypeError, InvalidStreamDescriptorError from lbrynet.p2p.Error import UnknownStreamTypeError, InvalidStreamDescriptorError

View file

@ -1,13 +1,12 @@
import json import json
import binascii import binascii
from google.protobuf import json_format # pylint: disable=no-name-in-module
import six import six
from lbrynet.schema.error import DecodeError, InvalidAddress from lbrynet.schema.error import DecodeError, InvalidAddress
from lbrynet.schema.legacy.migrate import migrate as schema_migrator from lbrynet.schema.legacy.migrate import migrate as schema_migrator
from lbrynet.schema.claim import ClaimDict from lbrynet.schema.claim import ClaimDict
from google.protobuf import json_format # pylint: disable=no-name-in-module
def migrate_json_claim_value(decoded_json): def migrate_json_claim_value(decoded_json):

View file

@ -4,7 +4,9 @@ from binascii import hexlify
from twisted.internet import defer, error from twisted.internet import defer, error
from twisted.trial import unittest from twisted.trial import unittest
from lbrynet.p2p.StreamDescriptor import get_sd_info from lbrynet.p2p.StreamDescriptor import get_sd_info
from lbrynet.extras import reflector from lbrynet.extras.reflector.server.server import ReflectorServerFactory
from lbrynet.extras.reflector.client.client import EncryptedFileReflectorClientFactory
from lbrynet.extras.reflector.client.blob import BlobReflectorClientFactory
from lbrynet.extras.daemon.PeerManager import PeerManager from lbrynet.extras.daemon.PeerManager import PeerManager
from lbrynet.p2p import BlobManager from lbrynet.p2p import BlobManager
from lbrynet.p2p import StreamDescriptor from lbrynet.p2p import StreamDescriptor
@ -96,7 +98,7 @@ class TestReflector(unittest.TestCase):
return d return d
def start_server(): def start_server():
server_factory = reflector.ServerFactory(peer_manager, self.server_blob_manager, server_factory = ReflectorServerFactory(peer_manager, self.server_blob_manager,
self.server_lbry_file_manager) self.server_lbry_file_manager)
from twisted.internet import reactor from twisted.internet import reactor
port = 8943 port = 8943
@ -180,7 +182,7 @@ class TestReflector(unittest.TestCase):
return d return d
def send_to_server(): def send_to_server():
factory = reflector.ClientFactory(self.client_blob_manager, self.stream_hash, self.sd_hash) factory = EncryptedFileReflectorClientFactory(self.client_blob_manager, self.stream_hash, self.sd_hash)
from twisted.internet import reactor from twisted.internet import reactor
reactor.connectTCP('localhost', self.port, factory) reactor.connectTCP('localhost', self.port, factory)
@ -209,7 +211,7 @@ class TestReflector(unittest.TestCase):
return d return d
def send_to_server(blob_hashes_to_send): def send_to_server(blob_hashes_to_send):
factory = reflector.BlobClientFactory( factory = BlobReflectorClientFactory(
self.client_blob_manager, self.client_blob_manager,
blob_hashes_to_send blob_hashes_to_send
) )
@ -248,7 +250,7 @@ class TestReflector(unittest.TestCase):
return d return d
def send_to_server(blob_hashes_to_send): def send_to_server(blob_hashes_to_send):
factory = reflector.BlobClientFactory( factory = BlobReflectorClientFactory(
self.client_blob_manager, self.client_blob_manager,
blob_hashes_to_send blob_hashes_to_send
) )
@ -302,7 +304,7 @@ class TestReflector(unittest.TestCase):
return d return d
def send_to_server_as_blobs(blob_hashes_to_send): def send_to_server_as_blobs(blob_hashes_to_send):
factory = reflector.BlobClientFactory( factory = BlobReflectorClientFactory(
self.client_blob_manager, self.client_blob_manager,
blob_hashes_to_send blob_hashes_to_send
) )
@ -313,7 +315,7 @@ class TestReflector(unittest.TestCase):
return factory.finished_deferred return factory.finished_deferred
def send_to_server_as_stream(result): def send_to_server_as_stream(result):
factory = reflector.ClientFactory(self.client_blob_manager, self.stream_hash, self.sd_hash) factory = EncryptedFileReflectorClientFactory(self.client_blob_manager, self.stream_hash, self.sd_hash)
from twisted.internet import reactor from twisted.internet import reactor
reactor.connectTCP('localhost', self.port, factory) reactor.connectTCP('localhost', self.port, factory)

View file

@ -3,7 +3,7 @@ from mock import MagicMock
from twisted.trial import unittest from twisted.trial import unittest
from twisted.internet import defer from twisted.internet import defer
from lbrynet.blob import BlobFile from lbrynet.blob.blob_file import BlobFile
from lbrynet.p2p.HTTPBlobDownloader import HTTPBlobDownloader from lbrynet.p2p.HTTPBlobDownloader import HTTPBlobDownloader
from tests.test_utils import mk_db_and_blob_dir, rm_db_and_blob_dir from tests.test_utils import mk_db_and_blob_dir, rm_db_and_blob_dir

View file

@ -1,4 +1,4 @@
from lbrynet.blob import BlobFile from lbrynet.blob.blob_file import BlobFile
from lbrynet.p2p.Error import DownloadCanceledError, InvalidDataError from lbrynet.p2p.Error import DownloadCanceledError, InvalidDataError
from tests.test_utils import mk_db_and_blob_dir, rm_db_and_blob_dir, random_lbry_hash from tests.test_utils import mk_db_and_blob_dir, rm_db_and_blob_dir, random_lbry_hash