fix up import paths
This commit is contained in:
parent
1c88cbc5f6
commit
67909724e7
3 changed files with 15 additions and 10 deletions
|
@ -57,8 +57,7 @@ from lbrynet.core.PTCWallet import PTCWallet
|
|||
from lbrynet.core.LBRYWallet import LBRYcrdWallet, LBRYumWallet
|
||||
from lbrynet.lbryfilemanager.LBRYFileManager import LBRYFileManager
|
||||
from lbrynet.lbryfile.LBRYFileMetadataManager import DBLBRYFileMetadataManager, TempLBRYFileMetadataManager
|
||||
from lbrynet.reflector.server import ReflectorServerFactory
|
||||
# from lbryum import LOG_PATH as lbryum_log
|
||||
from lbrynet import reflector
|
||||
|
||||
|
||||
# TODO: this code snippet is everywhere. Make it go away
|
||||
|
@ -686,13 +685,15 @@ class LBRYDaemon(jsonrpc.JSONRPC):
|
|||
def _start_reflector(self):
|
||||
if self.run_reflector_server:
|
||||
if self.reflector_port is not None:
|
||||
reflector_factory = ReflectorServerFactory(self.session.peer_manager, self.session.blob_manager)
|
||||
reflector_factory = reflector.ServerFactory(
|
||||
self.session.peer_manager,
|
||||
self.session.blob_manager
|
||||
)
|
||||
try:
|
||||
self.reflector_server_port = reactor.listenTCP(self.reflector_port, reflector_factory)
|
||||
except error.CannotListenError as e:
|
||||
import traceback
|
||||
log.error("Couldn't bind reflector to port %d. %s", self.reflector_port, traceback.format_exc())
|
||||
raise ValueError("%s lbrynet may already be running on your computer.", str(e))
|
||||
log.exception("Couldn't bind reflector to port %d", self.reflector_port)
|
||||
raise ValueError("{} lbrynet may already be running on your computer.".format(e))
|
||||
return defer.succeed(True)
|
||||
|
||||
def _stop_reflector(self):
|
||||
|
|
|
@ -12,7 +12,7 @@ from lbrynet.lbryfile.StreamDescriptor import publish_sd_blob
|
|||
from lbrynet.core.PaymentRateManager import PaymentRateManager
|
||||
from lbrynet.core.LBRYMetadata import Metadata, CURRENT_METADATA_VERSION
|
||||
from lbrynet.lbryfilemanager.LBRYFileDownloader import ManagedLBRYFileDownloader
|
||||
from lbrynet.reflector.client import LBRYFileReflectorClientFactory
|
||||
from lbrynet import reflector
|
||||
from lbrynet.conf import LOG_FILE_NAME, REFLECTOR_SERVERS
|
||||
from twisted.internet import threads, defer, reactor
|
||||
|
||||
|
@ -70,9 +70,11 @@ class Publisher(object):
|
|||
return d
|
||||
|
||||
def start_reflector(self):
|
||||
factory = LBRYFileReflectorClientFactory(self.session.blob_manager,
|
||||
self.lbry_file_manager.stream_info_manager,
|
||||
self.stream_hash)
|
||||
factory = reflector.ClientFactory(
|
||||
self.session.blob_manager,
|
||||
self.lbry_file_manager.stream_info_manager,
|
||||
self.stream_hash
|
||||
)
|
||||
reactor.connectTCP(self.reflector_server, self.reflector_port, factory)
|
||||
return factory.finished_deferred
|
||||
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
from lbrynet.reflector.server.server import ReflectorServerFactory as ServerFactory
|
||||
from lbrynet.reflector.client.client import LBRYFileReflectorClientFactory as ClientFactory
|
Loading…
Reference in a new issue