diff --git a/build/cli.py b/build/cli.py index 075c13b7f..5d9051c85 100644 --- a/build/cli.py +++ b/build/cli.py @@ -1,4 +1,4 @@ -from lbrynet.lbrynet_daemon import DaemonCLI +from lbrynet.daemon import DaemonCLI import logging logging.basicConfig() diff --git a/build/daemon.py b/build/daemon.py index 2ed0360ab..8fa643a22 100644 --- a/build/daemon.py +++ b/build/daemon.py @@ -1,4 +1,4 @@ -from lbrynet.lbrynet_daemon import DaemonControl +from lbrynet.daemon import DaemonControl if __name__ == '__main__': DaemonControl.start() diff --git a/lbrynet/lbrynet_daemon/Daemon.py b/lbrynet/daemon/Daemon.py similarity index 99% rename from lbrynet/lbrynet_daemon/Daemon.py rename to lbrynet/daemon/Daemon.py index 9e6538c98..469ccd72a 100644 --- a/lbrynet/lbrynet_daemon/Daemon.py +++ b/lbrynet/daemon/Daemon.py @@ -31,10 +31,10 @@ from lbrynet.lbry_file.client.EncryptedFileOptions import add_lbry_file_to_sd_id from lbrynet.lbry_file.EncryptedFileMetadataManager import DBEncryptedFileMetadataManager from lbrynet.lbry_file.StreamDescriptor import EncryptedFileStreamType from lbrynet.file_manager.EncryptedFileManager import EncryptedFileManager -from lbrynet.lbrynet_daemon.Downloader import GetStream -from lbrynet.lbrynet_daemon.Publisher import Publisher -from lbrynet.lbrynet_daemon.ExchangeRateManager import ExchangeRateManager -from lbrynet.lbrynet_daemon.auth.server import AuthJSONRPCServer +from lbrynet.daemon.Downloader import GetStream +from lbrynet.daemon.Publisher import Publisher +from lbrynet.daemon.ExchangeRateManager import ExchangeRateManager +from lbrynet.daemon.auth.server import AuthJSONRPCServer from lbrynet.core.PaymentRateManager import OnlyFreePaymentsManager from lbrynet.core import log_support, utils, system_info from lbrynet.core.StreamDescriptor import StreamDescriptorIdentifier, download_sd_blob diff --git a/lbrynet/lbrynet_daemon/DaemonCLI.py b/lbrynet/daemon/DaemonCLI.py similarity index 97% rename from lbrynet/lbrynet_daemon/DaemonCLI.py rename to lbrynet/daemon/DaemonCLI.py index e91cddd02..e58ffbab9 100644 --- a/lbrynet/lbrynet_daemon/DaemonCLI.py +++ b/lbrynet/daemon/DaemonCLI.py @@ -6,8 +6,8 @@ from docopt import docopt from collections import OrderedDict from lbrynet import conf from lbrynet.core import utils -from lbrynet.lbrynet_daemon.auth.client import JSONRPCException, LBRYAPIClient -from lbrynet.lbrynet_daemon.Daemon import LOADING_WALLET_CODE, Daemon +from lbrynet.daemon.auth.client import JSONRPCException, LBRYAPIClient +from lbrynet.daemon.Daemon import LOADING_WALLET_CODE, Daemon from lbrynet.core.system_info import get_platform from jsonrpc.common import RPCError from urllib2 import URLError, HTTPError diff --git a/lbrynet/lbrynet_daemon/DaemonControl.py b/lbrynet/daemon/DaemonControl.py similarity index 96% rename from lbrynet/lbrynet_daemon/DaemonControl.py rename to lbrynet/daemon/DaemonControl.py index e9ffec5bb..cb2e90217 100644 --- a/lbrynet/lbrynet_daemon/DaemonControl.py +++ b/lbrynet/daemon/DaemonControl.py @@ -9,8 +9,8 @@ from jsonrpc.proxy import JSONRPCProxy from lbrynet import analytics from lbrynet import conf from lbrynet.core import utils, system_info -from lbrynet.lbrynet_daemon.auth.client import LBRYAPIClient -from lbrynet.lbrynet_daemon.DaemonServer import DaemonServer +from lbrynet.daemon.auth.client import LBRYAPIClient +from lbrynet.daemon.DaemonServer import DaemonServer log = logging.getLogger(__name__) diff --git a/lbrynet/lbrynet_daemon/DaemonRequest.py b/lbrynet/daemon/DaemonRequest.py similarity index 100% rename from lbrynet/lbrynet_daemon/DaemonRequest.py rename to lbrynet/daemon/DaemonRequest.py diff --git a/lbrynet/lbrynet_daemon/DaemonServer.py b/lbrynet/daemon/DaemonServer.py similarity index 86% rename from lbrynet/lbrynet_daemon/DaemonServer.py rename to lbrynet/daemon/DaemonServer.py index abec2f04e..59e62eb95 100644 --- a/lbrynet/lbrynet_daemon/DaemonServer.py +++ b/lbrynet/daemon/DaemonServer.py @@ -6,11 +6,11 @@ from twisted.internet import defer, reactor, error from twisted.cred import portal from lbrynet import conf -from lbrynet.lbrynet_daemon.Daemon import Daemon -from lbrynet.lbrynet_daemon.Resources import LBRYindex, HostedEncryptedFile, EncryptedFileUpload -from lbrynet.lbrynet_daemon.auth.auth import PasswordChecker, HttpPasswordRealm -from lbrynet.lbrynet_daemon.auth.util import initialize_api_key_file -from lbrynet.lbrynet_daemon.DaemonRequest import DaemonRequest +from lbrynet.daemon.Daemon import Daemon +from lbrynet.daemon.Resources import LBRYindex, HostedEncryptedFile, EncryptedFileUpload +from lbrynet.daemon.auth.auth import PasswordChecker, HttpPasswordRealm +from lbrynet.daemon.auth.util import initialize_api_key_file +from lbrynet.daemon.DaemonRequest import DaemonRequest log = logging.getLogger(__name__) diff --git a/lbrynet/lbrynet_daemon/Downloader.py b/lbrynet/daemon/Downloader.py similarity index 100% rename from lbrynet/lbrynet_daemon/Downloader.py rename to lbrynet/daemon/Downloader.py diff --git a/lbrynet/lbrynet_daemon/ExchangeRateManager.py b/lbrynet/daemon/ExchangeRateManager.py similarity index 100% rename from lbrynet/lbrynet_daemon/ExchangeRateManager.py rename to lbrynet/daemon/ExchangeRateManager.py diff --git a/lbrynet/lbrynet_daemon/FileStreamer.py b/lbrynet/daemon/FileStreamer.py similarity index 100% rename from lbrynet/lbrynet_daemon/FileStreamer.py rename to lbrynet/daemon/FileStreamer.py diff --git a/lbrynet/lbrynet_daemon/Publisher.py b/lbrynet/daemon/Publisher.py similarity index 100% rename from lbrynet/lbrynet_daemon/Publisher.py rename to lbrynet/daemon/Publisher.py diff --git a/lbrynet/lbrynet_daemon/Resources.py b/lbrynet/daemon/Resources.py similarity index 98% rename from lbrynet/lbrynet_daemon/Resources.py rename to lbrynet/daemon/Resources.py index ad40bf882..9abe612b5 100644 --- a/lbrynet/lbrynet_daemon/Resources.py +++ b/lbrynet/daemon/Resources.py @@ -11,7 +11,7 @@ from twisted.web import server, static, resource from twisted.internet import defer, error from lbrynet import conf -from lbrynet.lbrynet_daemon.FileStreamer import EncryptedFileStreamer +from lbrynet.daemon.FileStreamer import EncryptedFileStreamer # TODO: omg, this code is essentially duplicated in Daemon diff --git a/lbrynet/lbrynet_daemon/__init__.py b/lbrynet/daemon/__init__.py similarity index 100% rename from lbrynet/lbrynet_daemon/__init__.py rename to lbrynet/daemon/__init__.py diff --git a/lbrynet/lbrynet_daemon/auth/__init__.py b/lbrynet/daemon/auth/__init__.py similarity index 100% rename from lbrynet/lbrynet_daemon/auth/__init__.py rename to lbrynet/daemon/auth/__init__.py diff --git a/lbrynet/lbrynet_daemon/auth/auth.py b/lbrynet/daemon/auth/auth.py similarity index 96% rename from lbrynet/lbrynet_daemon/auth/auth.py rename to lbrynet/daemon/auth/auth.py index fc61929ea..b1a8ad702 100644 --- a/lbrynet/lbrynet_daemon/auth/auth.py +++ b/lbrynet/daemon/auth/auth.py @@ -3,7 +3,7 @@ from zope.interface import implementer from twisted.cred import portal, checkers, credentials, error as cred_error from twisted.internet import defer from twisted.web import resource -from lbrynet.lbrynet_daemon.auth.util import load_api_keys +from lbrynet.daemon.auth.util import load_api_keys log = logging.getLogger(__name__) diff --git a/lbrynet/lbrynet_daemon/auth/client.py b/lbrynet/daemon/auth/client.py similarity index 98% rename from lbrynet/lbrynet_daemon/auth/client.py rename to lbrynet/daemon/auth/client.py index 019fc7c50..ffe0eafa2 100644 --- a/lbrynet/lbrynet_daemon/auth/client.py +++ b/lbrynet/daemon/auth/client.py @@ -5,7 +5,7 @@ import os import base64 import json -from lbrynet.lbrynet_daemon.auth.util import load_api_keys, APIKey, API_KEY_NAME, get_auth_message +from lbrynet.daemon.auth.util import load_api_keys, APIKey, API_KEY_NAME, get_auth_message from lbrynet import conf from jsonrpc.proxy import JSONRPCProxy diff --git a/lbrynet/lbrynet_daemon/auth/server.py b/lbrynet/daemon/auth/server.py similarity index 99% rename from lbrynet/lbrynet_daemon/auth/server.py rename to lbrynet/daemon/auth/server.py index 7452e084c..cf1cdad5c 100644 --- a/lbrynet/lbrynet_daemon/auth/server.py +++ b/lbrynet/daemon/auth/server.py @@ -15,8 +15,8 @@ from traceback import format_exc from lbrynet import conf from lbrynet.core.Error import InvalidAuthenticationToken from lbrynet.core import utils -from lbrynet.lbrynet_daemon.auth.util import APIKey, get_auth_message -from lbrynet.lbrynet_daemon.auth.client import LBRY_SECRET +from lbrynet.daemon.auth.util import APIKey, get_auth_message +from lbrynet.daemon.auth.client import LBRY_SECRET from lbrynet.undecorated import undecorated log = logging.getLogger(__name__) diff --git a/lbrynet/lbrynet_daemon/auth/util.py b/lbrynet/daemon/auth/util.py similarity index 100% rename from lbrynet/lbrynet_daemon/auth/util.py rename to lbrynet/daemon/auth/util.py diff --git a/lbrynet/lbrynet_daemon/daemon_scripts/Autofetcher.py b/lbrynet/daemon/daemon_scripts/Autofetcher.py similarity index 100% rename from lbrynet/lbrynet_daemon/daemon_scripts/Autofetcher.py rename to lbrynet/daemon/daemon_scripts/Autofetcher.py diff --git a/lbrynet/lbrynet_daemon/daemon_scripts/__init__.py b/lbrynet/daemon/daemon_scripts/__init__.py similarity index 100% rename from lbrynet/lbrynet_daemon/daemon_scripts/__init__.py rename to lbrynet/daemon/daemon_scripts/__init__.py diff --git a/lbrynet/lbrynet_daemon/daemon_scripts/migrateto025.py b/lbrynet/daemon/daemon_scripts/migrateto025.py similarity index 100% rename from lbrynet/lbrynet_daemon/daemon_scripts/migrateto025.py rename to lbrynet/daemon/daemon_scripts/migrateto025.py diff --git a/scripts/gen_api_docs.py b/scripts/gen_api_docs.py index 055bb2bfc..b13cbf6e0 100644 --- a/scripts/gen_api_docs.py +++ b/scripts/gen_api_docs.py @@ -9,7 +9,7 @@ import os.path as op import re import sys -from lbrynet.lbrynet_daemon.Daemon import Daemon +from lbrynet.daemon.Daemon import Daemon def _name(obj): diff --git a/setup.py b/setup.py index 094ed90c1..80c973cc9 100644 --- a/setup.py +++ b/setup.py @@ -35,8 +35,8 @@ requires = [ ] console_scripts = [ - 'lbrynet-daemon = lbrynet.lbrynet_daemon.DaemonControl:start', - 'lbrynet-cli = lbrynet.lbrynet_daemon.DaemonCLI:main' + 'lbrynet-daemon = lbrynet.daemon.DaemonControl:start', + 'lbrynet-cli = lbrynet.daemon.DaemonCLI:main' ] @@ -62,7 +62,6 @@ setup( long_description=long_description, keywords="lbry protocol media", license='MIT', - packages=find_packages(base_dir, exclude=['tests']), install_requires=requires, entry_points={'console_scripts': console_scripts}, diff --git a/tests/mocks.py b/tests/mocks.py index 63f451a23..5ef7d7a5c 100644 --- a/tests/mocks.py +++ b/tests/mocks.py @@ -6,7 +6,7 @@ from twisted.internet import defer from lbrynet.core import PTCWallet from lbrynet.core import BlobAvailability -from lbrynet.lbrynet_daemon import ExchangeRateManager as ERM +from lbrynet.daemon import ExchangeRateManager as ERM from lbrynet import conf KB = 2**10 diff --git a/tests/unit/lbrynet_daemon/auth/test_server.py b/tests/unit/lbrynet_daemon/auth/test_server.py index 1e833d245..4e1cb9086 100644 --- a/tests/unit/lbrynet_daemon/auth/test_server.py +++ b/tests/unit/lbrynet_daemon/auth/test_server.py @@ -2,7 +2,7 @@ import mock from twisted.trial import unittest from tests.mocks import mock_conf_settings -from lbrynet.lbrynet_daemon.auth import server +from lbrynet.daemon.auth import server class AuthJSONRPCServerTest(unittest.TestCase): diff --git a/tests/unit/lbrynet_daemon/test_Daemon.py b/tests/unit/lbrynet_daemon/test_Daemon.py index 3e4a741b5..d9bca0c0b 100644 --- a/tests/unit/lbrynet_daemon/test_Daemon.py +++ b/tests/unit/lbrynet_daemon/test_Daemon.py @@ -7,8 +7,8 @@ from twisted.trial import unittest from lbryschema.decode import smart_decode from lbrynet import conf from lbrynet.core import Session, PaymentRateManager, Wallet -from lbrynet.lbrynet_daemon.Daemon import Daemon as LBRYDaemon -from lbrynet.lbrynet_daemon import ExchangeRateManager +from lbrynet.daemon.Daemon import Daemon as LBRYDaemon +from lbrynet.daemon import ExchangeRateManager from tests import util from tests.mocks import mock_conf_settings, FakeNetwork diff --git a/tests/unit/lbrynet_daemon/test_DaemonCLI.py b/tests/unit/lbrynet_daemon/test_DaemonCLI.py index fc1b2dcb8..1ee330d42 100644 --- a/tests/unit/lbrynet_daemon/test_DaemonCLI.py +++ b/tests/unit/lbrynet_daemon/test_DaemonCLI.py @@ -1,5 +1,5 @@ from twisted.trial import unittest -from lbrynet.lbrynet_daemon import DaemonCLI +from lbrynet.daemon import DaemonCLI class DaemonCLITests(unittest.TestCase): diff --git a/tests/unit/lbrynet_daemon/test_Downloader.py b/tests/unit/lbrynet_daemon/test_Downloader.py index 836b363a0..9f6143479 100644 --- a/tests/unit/lbrynet_daemon/test_Downloader.py +++ b/tests/unit/lbrynet_daemon/test_Downloader.py @@ -7,13 +7,13 @@ from twisted.internet import defer from lbryschema.claim import ClaimDict from lbrynet.core import Session, PaymentRateManager, Wallet -from lbrynet.lbrynet_daemon import Downloader +from lbrynet.daemon import Downloader from lbrynet.core.StreamDescriptor import StreamDescriptorIdentifier,StreamMetadata from lbrynet.lbry_file.client.EncryptedFileOptions import add_lbry_file_to_sd_identifier from lbrynet.core.HashBlob import TempBlob from lbrynet.core.BlobManager import TempBlobManager from lbrynet.file_manager.EncryptedFileDownloader import ManagedEncryptedFileDownloaderFactory -from lbrynet.lbrynet_daemon.ExchangeRateManager import ExchangeRateManager +from lbrynet.daemon.ExchangeRateManager import ExchangeRateManager from tests.mocks import BlobAvailabilityTracker as DummyBlobAvailabilityTracker from tests.mocks import ExchangeRateManager as DummyExchangeRateManager diff --git a/tests/unit/lbrynet_daemon/test_ExchangeRateManager.py b/tests/unit/lbrynet_daemon/test_ExchangeRateManager.py index 9d3decbb0..f91a01ff6 100644 --- a/tests/unit/lbrynet_daemon/test_ExchangeRateManager.py +++ b/tests/unit/lbrynet_daemon/test_ExchangeRateManager.py @@ -1,5 +1,5 @@ from lbryschema.fee import Fee -from lbrynet.lbrynet_daemon import ExchangeRateManager +from lbrynet.daemon import ExchangeRateManager from lbrynet.core.Error import InvalidExchangeRateResponse from twisted.trial import unittest