From b6d986cb40d3b6af1680459ed8088deac4443680 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Sun, 4 Nov 2018 14:00:57 -0500 Subject: [PATCH] updated references after moving lbrynet/database into lbrynet/extras/daemon --- lbrynet/core/SinglePeerDownloader.py | 2 +- lbrynet/extras/daemon/Components.py | 4 ++-- lbrynet/extras/daemon/migrator/dbmigrator.py | 16 ++++++++-------- tests/functional/test_misc.py | 2 +- tests/functional/test_reflector.py | 2 +- tests/functional/test_streamify.py | 2 +- tests/unit/core/test_BlobManager.py | 4 ++-- tests/unit/core/test_Wallet.py | 7 +------ tests/unit/database/test_SQLiteStorage.py | 2 +- .../lbryfilemanager/test_EncryptedFileCreator.py | 4 +--- tests/unit/lbrynet_daemon/test_Daemon.py | 2 +- tests/unit/lbrynet_daemon/test_Downloader.py | 2 +- 12 files changed, 21 insertions(+), 28 deletions(-) diff --git a/lbrynet/core/SinglePeerDownloader.py b/lbrynet/core/SinglePeerDownloader.py index e81e0f033..73ef095de 100644 --- a/lbrynet/core/SinglePeerDownloader.py +++ b/lbrynet/core/SinglePeerDownloader.py @@ -11,7 +11,7 @@ from lbrynet.core.PaymentRateManager import OnlyFreePaymentsManager from lbrynet.core.client.BlobRequester import BlobRequester from lbrynet.core.client.StandaloneBlobDownloader import StandaloneBlobDownloader from lbrynet.core.client.ConnectionManager import ConnectionManager -from lbrynet.database.storage import SQLiteStorage +from lbrynet.extras.daemon.storage import SQLiteStorage from lbrynet.dht.peerfinder import DummyPeerFinder diff --git a/lbrynet/extras/daemon/Components.py b/lbrynet/extras/daemon/Components.py index 5d1b0b673..2e36a7cab 100644 --- a/lbrynet/extras/daemon/Components.py +++ b/lbrynet/extras/daemon/Components.py @@ -23,7 +23,7 @@ from lbrynet.core.server.BlobRequestHandler import BlobRequestHandlerFactory from lbrynet.core.server.ServerProtocol import ServerProtocolFactory from .Component import Component from .ExchangeRateManager import ExchangeRateManager -from lbrynet.database.storage import SQLiteStorage +from lbrynet.extras.daemon.storage import SQLiteStorage from lbrynet.dht import node, hashannouncer from lbrynet.file_manager.EncryptedFileManager import EncryptedFileManager from lbrynet.lbry_file.client.EncryptedFileDownloader import EncryptedFileSaverFactory @@ -159,7 +159,7 @@ class DatabaseComponent(Component): 'Your database is revision %i, expected %i' % (old_revision, self.get_current_db_revision())) if old_revision < self.get_current_db_revision(): - from lbrynet.database.migrator import dbmigrator + from lbrynet.extras.daemon.migrator import dbmigrator log.info("Upgrading your databases (revision %i to %i)", old_revision, self.get_current_db_revision()) yield threads.deferToThread( dbmigrator.migrate_db, GCS('data_dir'), old_revision, self.get_current_db_revision() diff --git a/lbrynet/extras/daemon/migrator/dbmigrator.py b/lbrynet/extras/daemon/migrator/dbmigrator.py index 44e8d417d..8b8f3bde8 100644 --- a/lbrynet/extras/daemon/migrator/dbmigrator.py +++ b/lbrynet/extras/daemon/migrator/dbmigrator.py @@ -7,21 +7,21 @@ def migrate_db(db_dir, start, end): current = start while current < end: if current == 1: - from lbrynet.database.migrator.migrate1to2 import do_migration + from lbrynet.extras.daemon.migrator.migrate1to2 import do_migration elif current == 2: - from lbrynet.database.migrator.migrate2to3 import do_migration + from lbrynet.extras.daemon.migrator.migrate2to3 import do_migration elif current == 3: - from lbrynet.database.migrator.migrate3to4 import do_migration + from lbrynet.extras.daemon.migrator.migrate3to4 import do_migration elif current == 4: - from lbrynet.database.migrator.migrate4to5 import do_migration + from lbrynet.extras.daemon.migrator.migrate4to5 import do_migration elif current == 5: - from lbrynet.database.migrator.migrate5to6 import do_migration + from lbrynet.extras.daemon.migrator.migrate5to6 import do_migration elif current == 6: - from lbrynet.database.migrator.migrate6to7 import do_migration + from lbrynet.extras.daemon.migrator.migrate6to7 import do_migration elif current == 7: - from lbrynet.database.migrator.migrate7to8 import do_migration + from lbrynet.extras.daemon.migrator.migrate7to8 import do_migration elif current == 8: - from lbrynet.database.migrator.migrate8to9 import do_migration + from lbrynet.extras.daemon.migrator import do_migration else: raise Exception("DB migration of version {} to {} is not available".format(current, current+1)) diff --git a/tests/functional/test_misc.py b/tests/functional/test_misc.py index eb2595537..71d360df5 100644 --- a/tests/functional/test_misc.py +++ b/tests/functional/test_misc.py @@ -12,7 +12,7 @@ from lbrynet.core.PeerManager import PeerManager from lbrynet.core.RateLimiter import RateLimiter from lbrynet.core.server.BlobRequestHandler import BlobRequestHandlerFactory from lbrynet.core.server.ServerProtocol import ServerProtocolFactory -from lbrynet.database.storage import SQLiteStorage +from lbrynet.extras.daemon.storage import SQLiteStorage from lbrynet.file_manager.EncryptedFileCreator import create_lbry_file from lbrynet.file_manager.EncryptedFileManager import EncryptedFileManager from lbrynet.lbry_file.client.EncryptedFileOptions import add_lbry_file_to_sd_identifier diff --git a/tests/functional/test_reflector.py b/tests/functional/test_reflector.py index 877d427e2..eb633b60f 100644 --- a/tests/functional/test_reflector.py +++ b/tests/functional/test_reflector.py @@ -10,7 +10,7 @@ from lbrynet.core import StreamDescriptor from lbrynet.file_manager import EncryptedFileCreator from lbrynet.file_manager.EncryptedFileManager import EncryptedFileManager from lbrynet.core.RateLimiter import DummyRateLimiter -from lbrynet.database.storage import SQLiteStorage +from lbrynet.extras.daemon.storage import SQLiteStorage from lbrynet.core.PaymentRateManager import OnlyFreePaymentsManager from tests import mocks from tests.util import mk_db_and_blob_dir, rm_db_and_blob_dir diff --git a/tests/functional/test_streamify.py b/tests/functional/test_streamify.py index 614aaff75..f9cf9efc5 100644 --- a/tests/functional/test_streamify.py +++ b/tests/functional/test_streamify.py @@ -9,7 +9,7 @@ from lbrynet.core.BlobManager import DiskBlobManager from lbrynet.core.StreamDescriptor import get_sd_info from lbrynet.core.PeerManager import PeerManager from lbrynet.core.RateLimiter import DummyRateLimiter -from lbrynet.database.storage import SQLiteStorage +from lbrynet.extras.daemon.storage import SQLiteStorage from lbrynet.core.PaymentRateManager import OnlyFreePaymentsManager from lbrynet.file_manager.EncryptedFileCreator import create_lbry_file from lbrynet.file_manager.EncryptedFileManager import EncryptedFileManager diff --git a/tests/unit/core/test_BlobManager.py b/tests/unit/core/test_BlobManager.py index 9435d176c..37512a852 100644 --- a/tests/unit/core/test_BlobManager.py +++ b/tests/unit/core/test_BlobManager.py @@ -4,11 +4,11 @@ import os import random import string from twisted.trial import unittest -from twisted.internet import defer, threads +from twisted.internet import defer from tests.util import random_lbry_hash from lbrynet.core.BlobManager import DiskBlobManager -from lbrynet.database.storage import SQLiteStorage +from lbrynet.extras.daemon.storage import SQLiteStorage from lbrynet.core.Peer import Peer from lbrynet import conf from lbrynet.core.cryptoutils import get_lbry_hash_obj diff --git a/tests/unit/core/test_Wallet.py b/tests/unit/core/test_Wallet.py index 729fa01d0..8170c8ae9 100644 --- a/tests/unit/core/test_Wallet.py +++ b/tests/unit/core/test_Wallet.py @@ -1,14 +1,9 @@ # pylint: skip-file -import os -import shutil import tempfile from decimal import Decimal -from collections import defaultdict from twisted.trial import unittest -from twisted.internet import threads, defer -from lbrynet.database.storage import SQLiteStorage -from tests.mocks import FakeNetwork +from twisted.internet import defer from lbrynet.core.Error import InsufficientFundsError #from lbrynet.core.Wallet import LBRYumWallet, ReservedPoints #from lbryum.commands import Commands diff --git a/tests/unit/database/test_SQLiteStorage.py b/tests/unit/database/test_SQLiteStorage.py index ce2783932..ab13e2307 100644 --- a/tests/unit/database/test_SQLiteStorage.py +++ b/tests/unit/database/test_SQLiteStorage.py @@ -6,7 +6,7 @@ from copy import deepcopy from twisted.internet import defer from twisted.trial import unittest from lbrynet import conf -from lbrynet.database.storage import SQLiteStorage, open_file_for_writing +from lbrynet.extras.daemon.storage import SQLiteStorage, open_file_for_writing from lbrynet.file_manager.EncryptedFileDownloader import ManagedEncryptedFileDownloader from tests.util import random_lbry_hash diff --git a/tests/unit/lbryfilemanager/test_EncryptedFileCreator.py b/tests/unit/lbryfilemanager/test_EncryptedFileCreator.py index 8c771abbb..d38cf4871 100644 --- a/tests/unit/lbryfilemanager/test_EncryptedFileCreator.py +++ b/tests/unit/lbryfilemanager/test_EncryptedFileCreator.py @@ -1,17 +1,15 @@ import json -import mock from twisted.trial import unittest from twisted.internet import defer from cryptography.hazmat.primitives.ciphers.algorithms import AES -from lbrynet.database.storage import SQLiteStorage from lbrynet.core.StreamDescriptor import get_sd_info, BlobStreamDescriptorReader from lbrynet.core.StreamDescriptor import StreamDescriptorIdentifier from lbrynet.core.BlobManager import DiskBlobManager from lbrynet.core.PeerManager import PeerManager from lbrynet.core.RateLimiter import DummyRateLimiter from lbrynet.core.PaymentRateManager import OnlyFreePaymentsManager -from lbrynet.database.storage import SQLiteStorage +from lbrynet.extras.daemon.storage import SQLiteStorage from lbrynet.file_manager import EncryptedFileCreator from lbrynet.file_manager.EncryptedFileManager import EncryptedFileManager from lbrynet.core.StreamDescriptor import JSONBytesEncoder diff --git a/tests/unit/lbrynet_daemon/test_Daemon.py b/tests/unit/lbrynet_daemon/test_Daemon.py index 9c2b1a3ef..fa822ca0e 100644 --- a/tests/unit/lbrynet_daemon/test_Daemon.py +++ b/tests/unit/lbrynet_daemon/test_Daemon.py @@ -10,7 +10,7 @@ from faker import Faker from lbrynet.schema.decode import smart_decode from lbrynet import conf -from lbrynet.database.storage import SQLiteStorage +from lbrynet.extras.daemon.storage import SQLiteStorage from lbrynet.extras.daemon.ComponentManager import ComponentManager from lbrynet.extras.daemon.Components import DATABASE_COMPONENT, DHT_COMPONENT, WALLET_COMPONENT, STREAM_IDENTIFIER_COMPONENT from lbrynet.extras.daemon.Components import f2d diff --git a/tests/unit/lbrynet_daemon/test_Downloader.py b/tests/unit/lbrynet_daemon/test_Downloader.py index fed267aaa..2da3f88db 100644 --- a/tests/unit/lbrynet_daemon/test_Downloader.py +++ b/tests/unit/lbrynet_daemon/test_Downloader.py @@ -11,7 +11,7 @@ from lbrynet.core.BlobManager import DiskBlobManager from lbrynet.core.RateLimiter import DummyRateLimiter from lbrynet.extras.daemon import Downloader from lbrynet.extras.daemon import ExchangeRateManager -from lbrynet.database.storage import SQLiteStorage +from lbrynet.extras.daemon.storage import SQLiteStorage from lbrynet.dht.peerfinder import DummyPeerFinder from lbrynet.file_manager.EncryptedFileStatusReport import EncryptedFileStatusReport from lbrynet.file_manager.EncryptedFileDownloader import ManagedEncryptedFileDownloader