diff --git a/.dockerignore b/.dockerignore index 4958bd30f9e..05a2e7eee5d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,4 +3,4 @@ venv** .github .pytest** doc -experiment \ No newline at end of file +scripts diff --git a/.flake8 b/.flake8 index 61918163491..7c36ff61a5c 100644 --- a/.flake8 +++ b/.flake8 @@ -2,4 +2,4 @@ max-line-length = 120 select=E901,E999,F821,F822,F823,I100,I101,I201,I202,T001,T002,T003,T004 ignore=E203,W503,C0330 -application-import-names=tribler_core,tribler_gui,run_tribler,experiment +application-import-names=tribler,run_tribler diff --git a/.gitignore b/.gitignore index 5512d95a250..32e63f2bbb1 100644 --- a/.gitignore +++ b/.gitignore @@ -84,7 +84,7 @@ dist/ annotations.txt # Screenshots taken by GUI tests -tribler_gui/screenshots +tribler/gui/screenshots #venv venv/ diff --git a/.isort.cfg b/.isort.cfg index 942e609db3c..41aa578c58e 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -9,5 +9,5 @@ combine_as_imports=True force_sort_within_sections=True line_length=120 known_future_library=future -known_first_party=tribler_core,tribler_gui,run_tribler +known_first_party=tribler,run_tribler known_third_party=pony,twisted,six,anydex,ipv8,libtorrent,lz4,PyQt5,zope,aiohttp,psutil,configobj,ipv8_service,asynctest,numpy,networkx,async_timeout,cherrypy,nose,validate,check_os,matplotlib,pyqtgraph,_socket,aiohttp_apispec,marshmallow,PIL,anyio,freezegun,yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index db7b840aa0a..92a6b8d97e9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,8 +20,7 @@ repos: - id: black files: | (?x)( - ^src/tribler-gui/| - ^src/tribler-core/tribler_core/modules/metadata_store/ + ^src/tribler/gui/ ) types: [file, python] @@ -43,8 +42,8 @@ repos: language: system files: | (?x)( - ^src/tribler-gui/| - ^src/tribler-core/ + ^src/tribler/gui/| + ^src/tribler/core/ ) types: [file, python] diff --git a/.pylintrc b/.pylintrc index 35c7383cbbf..d3f27775106 100644 --- a/.pylintrc +++ b/.pylintrc @@ -5,11 +5,11 @@ # Python code to execute, usually for sys.path manipulation such as # pygtk.require(). -init-hook='import sys; import os; sys.path.append(os.path.join("src", "pyipv8")); sys.path.append(os.path.join("src", "anydex"))' +init-hook='import sys; import os;' # Add files or directories to the blacklist. They should be base names, not # paths. -ignore=.git,libnacl,data,.pylint.rc,pyproject.toml +ignore=.git,libnacl,data,.pylint.rc # Pickle collected data for later comparisons. persistent=yes diff --git a/.sonarcloud.properties b/.sonarcloud.properties index 4538ba406ac..a9b04a4e2d2 100644 --- a/.sonarcloud.properties +++ b/.sonarcloud.properties @@ -1,6 +1,6 @@ # Path to sources sonar.sources=. -sonar.exclusions=build/**,doc/**,src/anydex/**,src/pyipv8/** +sonar.exclusions=build/**,doc/** # Source encoding sonar.sourceEncoding=UTF-8 diff --git a/Dockerfile b/Dockerfile index 238b3ce63b5..dabeb3583ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ WORKDIR /home/user # need to be built every time the source code changes. # This reduces the docker build time. RUN mkdir requirements -COPY ./src/tribler-core/tribler_core/requirements.txt requirements/core-requirements.txt +COPY ./requirements-core.txt requirements/core-requirements.txt RUN pip3 install -r requirements/core-requirements.txt # Copy the source code and set the working directory diff --git a/build/debian/makedist_debian.sh b/build/debian/makedist_debian.sh index c42b6c115e7..2ea71e7a6af 100755 --- a/build/debian/makedist_debian.sh +++ b/build/debian/makedist_debian.sh @@ -20,7 +20,7 @@ rm -rf build/debian/tribler/usr/share/tribler python3 build/update_version_from_git.py # ----- Install pip dependencies before the build -python3 -m pip install --upgrade -r src/requirements.txt +python3 -m pip install --upgrade -r requirements.txt python3 -m PyInstaller tribler.spec diff --git a/build/mac/makedist_macos.sh b/build/mac/makedist_macos.sh index c1649ea7ed0..343ae882504 100755 --- a/build/mac/makedist_macos.sh +++ b/build/mac/makedist_macos.sh @@ -14,7 +14,7 @@ export RESOURCES=build/mac/resources # ----- Build # ----- Install pip dependencies before the build -python3 -m pip install --upgrade -r src/requirements.txt +python3 -m pip install --upgrade -r requirements.txt PI=pyinstaller $PI tribler.spec diff --git a/build/systemd/anontunnel_helper@.service b/build/systemd/anontunnel_helper@.service index 91917d98b30..4306f77fc26 100644 --- a/build/systemd/anontunnel_helper@.service +++ b/build/systemd/anontunnel_helper@.service @@ -13,11 +13,11 @@ Environment=HOME=/var/lib/tunnel_helper/%I Environment=HELPER_INDEX=%I Environment=HELPER_BASE=35000 Environment=EXTRA_TUNNEL_ARGS=-- -Environment=PYTHONPATH=./src/pyipv8:./src/anydex:./src/tribler-core +Environment=PYTHONPATH=./src WorkingDirectory=/opt/tribler ExecStartPre=/bin/mkdir -p ${HOME} -ExecStart=/usr/bin/python3 src/tribler-core/run_tunnel_helper.py $EXTRA_TUNNEL_ARGS +ExecStart=/usr/bin/python3 scripts/exit_node/run_exit_node.py.py $EXTRA_TUNNEL_ARGS [Install] WantedBy=multi-user.target diff --git a/build/systemd/bandwidth-crawler.service b/build/systemd/bandwidth-crawler.service index 8da6eb7ab38..255e74ecf26 100644 --- a/build/systemd/bandwidth-crawler.service +++ b/build/systemd/bandwidth-crawler.service @@ -7,9 +7,9 @@ Type=simple User=crawler Group=crawler Restart=always -Environment=PYTHONPATH=./src/pyipv8:./src/tribler-core +Environment=PYTHONPATH=./src WorkingDirectory=/opt/tribler -ExecStart=/usr/bin/python3 src/tribler-core/run_bandwidth_crawler.py --statedir /var/lib/crawler $EXTRA_CRAWLER_ARGS +ExecStart=/usr/bin/python3 scripts/bandwidth_crawler/run_bandwidth_crawler.py --statedir /var/lib/crawler $EXTRA_CRAWLER_ARGS [Install] WantedBy=multi-user.target diff --git a/build/update_version_from_git.py b/build/update_version_from_git.py index e4c1928e481..5cadc20f597 100755 --- a/build/update_version_from_git.py +++ b/build/update_version_from_git.py @@ -42,7 +42,7 @@ def run_command(cmd): logger.info("Build date: %s", build_date) logger.info('Writing runtime version info.') - with open(path.join('src', 'tribler-core', 'tribler_core', 'version.py'), 'w') as f: + with open(path.join('src', 'tribler', 'core', 'version.py'), 'w') as f: f.write( f'version_id = "{version_id}"{linesep}' f'build_date = "{build_date}"{linesep}' diff --git a/build/win/makedist_win.bat b/build/win/makedist_win.bat index 7d23c6742e6..d9d59dffa7b 100644 --- a/build/win/makedist_win.bat +++ b/build/win/makedist_win.bat @@ -43,7 +43,7 @@ call build\win\clean.bat REM ----- Build REM ----- Install pip dependencies before the build -python3 -m pip install --upgrade -r src\requirements.txt +python3 -m pip install --upgrade -r requirements.txt REM Arno: When adding files here, make sure tribler.nsi actually REM packs them in the installer .EXE diff --git a/doc/conf.py b/doc/conf.py index 30999975f6c..816ea7eb91c 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -23,22 +23,19 @@ # pylint: disable=wrong-import-position root_dir = os.path.abspath(os.path.join(os.path.dirname(__name__), '..')) tribler_components = [ - os.path.join(root_dir, "src", "pyipv8"), - os.path.join(root_dir, "src", "anydex"), - os.path.join(root_dir, "src", "tribler-core"), - os.path.join(root_dir, "src", "tribler-gui"), + os.path.join(root_dir, "src"), os.path.join(root_dir, "doc"), ] for component in tribler_components: sys.path.append(str(component)) -from tribler_core.utilities.dependencies import Scope, get_dependencies -from tribler_core.utilities.patch_import import patch_import +from tribler.core.utilities.dependencies import Scope, get_dependencies +from tribler.core.utilities.patch_import import patch_import modules_to_mock = set(get_dependencies(scope=Scope.core)) | {'libtorrent', 'validate'} with patch_import(modules=modules_to_mock): - from tribler_core.components.restapi.rest.root_endpoint import RootEndpoint + from tribler.core.components.restapi.rest.root_endpoint import RootEndpoint add_endpoint = RootEndpoint.add_endpoint RootEndpoint.add_endpoint = lambda self, path, ep: add_endpoint(self, path, ep) \ if path not in ['/ipv8', '/market', '/wallets'] else None diff --git a/doc/development/development_on_linux.rst b/doc/development/development_on_linux.rst index 0ddac82c122..8160487efca 100644 --- a/doc/development/development_on_linux.rst +++ b/doc/development/development_on_linux.rst @@ -20,15 +20,9 @@ Install python packages: .. code-block:: bash - pip3 install --upgrade -r tribler/src/requirements.txt + pip3 install --upgrade -r tribler/requirements.txt -Install py-ipv8 python dependencies: - -.. code-block:: bash - - pip3 install --upgrade -r tribler/src/pyipv8/requirements.txt - Run Tribler by executing the following commands: .. code-block:: bash @@ -58,14 +52,7 @@ Install python packages: .. code-block:: bash - pip3 install --upgrade -r tribler/src/requirements.txt - - -Install py-ipv8 python dependencies - -.. code-block:: bash - - pip3 install --upgrade -r tribler/src/pyipv8/requirements.txt + pip3 install --upgrade -r tribler/requirements.txt Run Tribler by executing the following commands: diff --git a/doc/development/development_on_osx.rst b/doc/development/development_on_osx.rst index 046d2b9dd65..9ce65effb33 100644 --- a/doc/development/development_on_osx.rst +++ b/doc/development/development_on_osx.rst @@ -72,7 +72,7 @@ There are a bunch of other packages that can easily be installed using pip and b .. code-block:: bash brew install gmp mpfr libmpc libsodium - cd src && python3 -m pip install -r requirements.txt + python3 -m pip install -r requirements.txt Tribler ------- diff --git a/doc/development/development_on_windows.rst b/doc/development/development_on_windows.rst index 4d21ebc4e7e..96f7e2ab871 100644 --- a/doc/development/development_on_windows.rst +++ b/doc/development/development_on_windows.rst @@ -60,10 +60,6 @@ Additional Packages There are some additional packages which should be installed. They can easily be installed using pip: .. code-block:: bash - cd src - pip install --upgrade -r requirements.txt - - cd src/pyipv8 pip install --upgrade -r requirements.txt Running Tribler @@ -72,7 +68,7 @@ Running Tribler You should now be able to run Tribler from command line. Grab a copy of the Tribler source code and navigate in a command line interface to the source code directory. Start Tribler by executing the Batch script in the ``tribler/src`` directory: .. code-block:: bash - + cd src tribler.bat If there are any problems with the guide above, please feel free to fix any errors or `create an issue `_ so we can look into it. diff --git a/doc/extract_swagger.py b/doc/extract_swagger.py index fa34375f465..e313f568ba7 100644 --- a/doc/extract_swagger.py +++ b/doc/extract_swagger.py @@ -7,9 +7,9 @@ import yaml -from tribler_core.components.restapi.rest.rest_manager import ApiKeyMiddleware, RESTManager, error_middleware -from tribler_core.components.restapi.rest.root_endpoint import RootEndpoint -from tribler_core.config.tribler_config import TriblerConfig +from tribler.core.components.restapi.rest.rest_manager import ApiKeyMiddleware, RESTManager, error_middleware +from tribler.core.components.restapi.rest.root_endpoint import RootEndpoint +from tribler.core.config.tribler_config import TriblerConfig async def extract_swagger(destination_fn): diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 551e4e4db26..00000000000 --- a/pyproject.toml +++ /dev/null @@ -1,14 +0,0 @@ -[tool.black] -line-length = 120 -skip-string-normalization = true -include = '(src/tribler-core/tribler_core/modules/metadata_store)/.*\.pyi?$' - -exclude = ''' -/( - \.git - | \.venv - | \.idea - | snap - | doc -)/ -''' diff --git a/src/tribler-core/tribler_core/requirements.txt b/requirements-core.txt similarity index 100% rename from src/tribler-core/tribler_core/requirements.txt rename to requirements-core.txt diff --git a/src/requirements-test.txt b/requirements-test.txt similarity index 100% rename from src/requirements-test.txt rename to requirements-test.txt diff --git a/src/tribler-gui/tribler_gui/requirements.txt b/requirements.txt similarity index 62% rename from src/tribler-gui/tribler_gui/requirements.txt rename to requirements.txt index d6d5fb7d4a2..d995e88ff58 100644 --- a/src/tribler-gui/tribler_gui/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ --r ../../tribler-core/tribler_core/requirements.txt +-r requirements-core.txt Pillow==9.0.1 PyQt5==5.15.1 diff --git a/scripts/bandwidth_crawler/README.md b/scripts/bandwidth_crawler/README.md new file mode 100644 index 00000000000..60e572d85da --- /dev/null +++ b/scripts/bandwidth_crawler/README.md @@ -0,0 +1,12 @@ +# Bandwidth Crawler + +## Requirements + +* Export the `src` directory to `PYTHONPATH` +* Install Tribler's requirements from `requirements.txt` + +## Execution + +```shell +python3 run_bandwidth_crawler.py +``` \ No newline at end of file diff --git a/src/tribler-core/run_bandwidth_crawler.py b/scripts/bandwidth_crawler/run_bandwidth_crawler.py similarity index 87% rename from src/tribler-core/run_bandwidth_crawler.py rename to scripts/bandwidth_crawler/run_bandwidth_crawler.py index ba057adbe6d..9080dc3050b 100644 --- a/src/tribler-core/run_bandwidth_crawler.py +++ b/scripts/bandwidth_crawler/run_bandwidth_crawler.py @@ -8,11 +8,11 @@ from asyncio import ensure_future, get_event_loop from pathlib import Path -from tribler_core.components.bandwidth_accounting.bandwidth_accounting_component import BandwidthAccountingComponent -from tribler_core.components.ipv8.ipv8_component import Ipv8Component -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.config.tribler_config import TriblerConfig -from tribler_core.start_core import Session +from tribler.core.components.bandwidth_accounting.bandwidth_accounting_component import BandwidthAccountingComponent +from tribler.core.components.ipv8.ipv8_component import Ipv8Component +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.config.tribler_config import TriblerConfig +from tribler.core.start_core import Session class PortAction(argparse.Action): diff --git a/scripts/exit_node/README.md b/scripts/exit_node/README.md new file mode 100644 index 00000000000..11916bf799e --- /dev/null +++ b/scripts/exit_node/README.md @@ -0,0 +1,12 @@ +# Exit Node + +## Requirements + +* Export the `src` directory to `PYTHONPATH` +* Install Tribler's requirements from `requirements.txt` + +## Execution + +```shell +python3 run_exit_node.py +``` \ No newline at end of file diff --git a/src/tribler-core/run_tunnel_helper.py b/scripts/exit_node/run_exit_node.py similarity index 93% rename from src/tribler-core/run_tunnel_helper.py rename to scripts/exit_node/run_exit_node.py index 044d0201622..47b13b92138 100644 --- a/src/tribler-core/run_tunnel_helper.py +++ b/scripts/exit_node/run_exit_node.py @@ -14,18 +14,18 @@ from ipv8.messaging.anonymization.tunnel import Circuit from ipv8.taskmanager import TaskManager -from tribler_core import notifications -from tribler_core.components.bandwidth_accounting.bandwidth_accounting_component import BandwidthAccountingComponent -from tribler_core.components.base import Session -from tribler_core.components.ipv8.ipv8_component import Ipv8Component -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.resource_monitor.resource_monitor_component import ResourceMonitorComponent -from tribler_core.components.restapi.restapi_component import RESTComponent -from tribler_core.components.socks_servers.socks_servers_component import SocksServersComponent -from tribler_core.components.tunnel.tunnel_component import TunnelsComponent -from tribler_core.config.tribler_config import TriblerConfig -from tribler_core.utilities.osutils import get_root_state_directory -from tribler_core.utilities.path_util import Path +from tribler.core import notifications +from tribler.core.components.bandwidth_accounting.bandwidth_accounting_component import BandwidthAccountingComponent +from tribler.core.components.base import Session +from tribler.core.components.ipv8.ipv8_component import Ipv8Component +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.resource_monitor.resource_monitor_component import ResourceMonitorComponent +from tribler.core.components.restapi.restapi_component import RESTComponent +from tribler.core.components.socks_servers.socks_servers_component import SocksServersComponent +from tribler.core.components.tunnel.tunnel_component import TunnelsComponent +from tribler.core.config.tribler_config import TriblerConfig +from tribler.core.utilities.osutils import get_root_state_directory +from tribler.core.utilities.path_util import Path logger = logging.getLogger(__name__) diff --git a/experiment/README.md b/scripts/experiments/README.md similarity index 100% rename from experiment/README.md rename to scripts/experiments/README.md diff --git a/experiment/popularity_community/README.md b/scripts/experiments/popularity_community/README.md similarity index 94% rename from experiment/popularity_community/README.md rename to scripts/experiments/popularity_community/README.md index 22df31fbcb5..545afaa587e 100644 --- a/experiment/popularity_community/README.md +++ b/scripts/experiments/popularity_community/README.md @@ -36,7 +36,7 @@ time_in_sec,total,alive ### Usage ``` -export PYTHONPATH=${PYTHONPATH}:`echo ../.. ../../src/{pyipv8,tribler-core} | tr " " :` +export PYTHONPATH=${PYTHONPATH}:../../../src python3 initial_filling.py [-i ] [-t ] [-f ] ``` @@ -79,7 +79,7 @@ Where: ### Usage ``` -export PYTHONPATH=${PYTHONPATH}:`echo ../.. ../../src/{pyipv8,tribler-core} | tr " " :` +export PYTHONPATH=${PYTHONPATH}:../../../src python3 crawl_torrents.py [-t ] [-f ] [-v] [--peers_count_csv=] @@ -160,7 +160,7 @@ Where: ### Usage ``` -export PYTHONPATH=${PYTHONPATH}:`echo ../.. ../../src/{pyipv8,tribler-core} | tr " " :` +export PYTHONPATH=${PYTHONPATH}:../../../src python3 analyze_crawled_data.py [-d ] [-f ] [-l ] [-v] diff --git a/experiment/popularity_community/analyze_crawled_data.py b/scripts/experiments/popularity_community/analyze_crawled_data.py similarity index 98% rename from experiment/popularity_community/analyze_crawled_data.py rename to scripts/experiments/popularity_community/analyze_crawled_data.py index 29186267530..4367d7d3e62 100644 --- a/experiment/popularity_community/analyze_crawled_data.py +++ b/scripts/experiments/popularity_community/analyze_crawled_data.py @@ -24,7 +24,7 @@ ### Usage ``` -export PYTHONPATH=${PYTHONPATH}:`echo ../.. ../../src/{pyipv8,tribler-core} | tr " " :` +export PYTHONPATH=${PYTHONPATH}:../../../src python3 analyze_crawled_data.py [-d ] [-f ] [-l ] [-v] diff --git a/experiment/popularity_community/crawl_torrents.py b/scripts/experiments/popularity_community/crawl_torrents.py similarity index 96% rename from experiment/popularity_community/crawl_torrents.py rename to scripts/experiments/popularity_community/crawl_torrents.py index c1d4b5d0e9e..75412aff918 100644 --- a/experiment/popularity_community/crawl_torrents.py +++ b/scripts/experiments/popularity_community/crawl_torrents.py @@ -1,7 +1,7 @@ """This script crawl first 100 torrens from random nodes in the network. ``` -export PYTHONPATH=${PYTHONPATH}:`echo ../.. ../../src/{pyipv8,tribler-core} | tr " " :` +export PYTHONPATH=${PYTHONPATH}:../../../src python3 crawl_torrents.py [-t ] [-f ] [-v] [--peers_count_csv=] @@ -42,14 +42,14 @@ from ipv8.lazy_community import lazy_wrapper from ipv8.peer import Peer from ipv8.peerdiscovery.discovery import RandomWalk -from tribler_core.components.metadata_store.db.serialization import REGULAR_TORRENT -from tribler_core.components.metadata_store.remote_query_community.remote_query_community import RemoteQueryCommunity, \ +from tribler.core.components.metadata_store.db.serialization import REGULAR_TORRENT +from tribler.core.components.metadata_store.remote_query_community.remote_query_community import RemoteQueryCommunity, \ RemoteSelectPayload, \ SelectRequest, \ SelectResponsePayload -from tribler_core.components.metadata_store.remote_query_community.settings import RemoteQueryCommunitySettings -from tribler_core.utilities.tiny_tribler_service import TinyTriblerService -from tribler_core.utilities.unicode import hexlify +from tribler.core.components.metadata_store.remote_query_community.settings import RemoteQueryCommunitySettings +from tribler.core.utilities.tiny_tribler_service import TinyTriblerService +from tribler.core.utilities.unicode import hexlify # flake8: noqa diff --git a/experiment/popularity_community/initial_filling.py b/scripts/experiments/popularity_community/initial_filling.py similarity index 87% rename from experiment/popularity_community/initial_filling.py rename to scripts/experiments/popularity_community/initial_filling.py index 2a113af2007..7a5f59cee49 100644 --- a/experiment/popularity_community/initial_filling.py +++ b/scripts/experiments/popularity_community/initial_filling.py @@ -12,18 +12,18 @@ from ipv8.peerdiscovery.discovery import RandomWalk from ipv8_service import IPv8 -from tribler_core.components.ipv8.ipv8_component import Ipv8Component -from tribler_core.components.libtorrent.libtorrent_component import LibtorrentComponent -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent -from tribler_core.components.popularity.popularity_component import PopularityComponent -from tribler_core.components.restapi.restapi_component import RESTComponent -from tribler_core.components.socks_servers.socks_servers_component import SocksServersComponent -from tribler_core.components.torrent_checker.torrent_checker_component import TorrentCheckerComponent -from tribler_core.config.tribler_config import TriblerConfig -from tribler_core.components.gigachannel.community.sync_strategy import RemovePeers -from tribler_core.components.popularity.community.popularity_community import PopularityCommunity -from tribler_core.utilities.tiny_tribler_service import TinyTriblerService +from tribler.core.components.ipv8.ipv8_component import Ipv8Component +from tribler.core.components.libtorrent.libtorrent_component import LibtorrentComponent +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.metadata_store.metadata_store_component import MetadataStoreComponent +from tribler.core.components.popularity.popularity_component import PopularityComponent +from tribler.core.components.restapi.restapi_component import RESTComponent +from tribler.core.components.socks_servers.socks_servers_component import SocksServersComponent +from tribler.core.components.torrent_checker.torrent_checker_component import TorrentCheckerComponent +from tribler.core.config.tribler_config import TriblerConfig +from tribler.core.components.gigachannel.community.sync_strategy import RemovePeers +from tribler.core.components.popularity.community.popularity_community import PopularityCommunity +from tribler.core.utilities.tiny_tribler_service import TinyTriblerService _logger = logging.getLogger(__name__) interval_in_sec = None diff --git a/experiment/requirements.txt b/scripts/experiments/requirements.txt similarity index 100% rename from experiment/requirements.txt rename to scripts/experiments/requirements.txt diff --git a/experiment/__init__.py b/scripts/experiments/tunnel_community/__init__.py similarity index 100% rename from experiment/__init__.py rename to scripts/experiments/tunnel_community/__init__.py diff --git a/experiment/tunnel_community/hidden_peer_discovery.py b/scripts/experiments/tunnel_community/hidden_peer_discovery.py similarity index 88% rename from experiment/tunnel_community/hidden_peer_discovery.py rename to scripts/experiments/tunnel_community/hidden_peer_discovery.py index 67b543bceec..d7306b1ff0b 100644 --- a/experiment/tunnel_community/hidden_peer_discovery.py +++ b/scripts/experiments/tunnel_community/hidden_peer_discovery.py @@ -6,12 +6,12 @@ from ipv8.taskmanager import TaskManager -from tribler_core.components.ipv8.ipv8_component import Ipv8Component -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.restapi.restapi_component import RESTComponent -from tribler_core.components.tunnel.tunnel_component import TunnelsComponent -from tribler_core.config.tribler_config import TriblerConfig -from tribler_core.utilities.tiny_tribler_service import TinyTriblerService +from tribler.core.components.ipv8.ipv8_component import Ipv8Component +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.restapi.restapi_component import RESTComponent +from tribler.core.components.tunnel.tunnel_component import TunnelsComponent +from tribler.core.config.tribler_config import TriblerConfig +from tribler.core.utilities.tiny_tribler_service import TinyTriblerService EXPERIMENT_RUN_TIME = int(os.environ.get('EXPERIMENT_RUN_TIME', 3600 * 3)) diff --git a/experiment/tunnel_community/hidden_peer_discovery.r b/scripts/experiments/tunnel_community/hidden_peer_discovery.r similarity index 100% rename from experiment/tunnel_community/hidden_peer_discovery.r rename to scripts/experiments/tunnel_community/hidden_peer_discovery.r diff --git a/experiment/tunnel_community/speed_test_e2e.py b/scripts/experiments/tunnel_community/speed_test_e2e.py similarity index 91% rename from experiment/tunnel_community/speed_test_e2e.py rename to scripts/experiments/tunnel_community/speed_test_e2e.py index 6d67d034e6a..74d26da3f30 100644 --- a/experiment/tunnel_community/speed_test_e2e.py +++ b/scripts/experiments/tunnel_community/speed_test_e2e.py @@ -6,9 +6,9 @@ from ipv8.messaging.anonymization.tunnel import EXIT_NODE, ORIGINATOR from ipv8.taskmanager import task -from tribler_core.components.tunnel.tunnel_component import TunnelsComponent +from tribler.core.components.tunnel.tunnel_component import TunnelsComponent -from experiment.tunnel_community.speed_test_exit import EXPERIMENT_NUM_CIRCUITS, EXPERIMENT_NUM_HOPS, \ +from scripts.experiments.tunnel_community.speed_test_exit import EXPERIMENT_NUM_CIRCUITS, EXPERIMENT_NUM_HOPS, \ Service as SpeedTestExitService EXPERIMENT_NUM_MB = int(os.environ.get('EXPERIMENT_NUM_MB', 10)) diff --git a/experiment/tunnel_community/speed_test_e2e.r b/scripts/experiments/tunnel_community/speed_test_e2e.r similarity index 100% rename from experiment/tunnel_community/speed_test_e2e.r rename to scripts/experiments/tunnel_community/speed_test_e2e.r diff --git a/experiment/tunnel_community/speed_test_exit.py b/scripts/experiments/tunnel_community/speed_test_exit.py similarity index 91% rename from experiment/tunnel_community/speed_test_exit.py rename to scripts/experiments/tunnel_community/speed_test_exit.py index 64d1194c1ae..93442c1c35b 100644 --- a/experiment/tunnel_community/speed_test_exit.py +++ b/scripts/experiments/tunnel_community/speed_test_exit.py @@ -6,12 +6,12 @@ from ipv8.messaging.anonymization.utils import run_speed_test from ipv8.taskmanager import TaskManager -from tribler_core.components.ipv8.ipv8_component import Ipv8Component -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.restapi.restapi_component import RESTComponent -from tribler_core.components.tunnel.tunnel_component import TunnelsComponent -from tribler_core.config.tribler_config import TriblerConfig -from tribler_core.utilities.tiny_tribler_service import TinyTriblerService +from tribler.core.components.ipv8.ipv8_component import Ipv8Component +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.restapi.restapi_component import RESTComponent +from tribler.core.components.tunnel.tunnel_component import TunnelsComponent +from tribler.core.config.tribler_config import TriblerConfig +from tribler.core.utilities.tiny_tribler_service import TinyTriblerService EXPERIMENT_NUM_MB = int(os.environ.get('EXPERIMENT_NUM_MB', 25)) EXPERIMENT_NUM_CIRCUITS = int(os.environ.get('EXPERIMENT_NUM_CIRCUITS', 10)) diff --git a/experiment/tunnel_community/speed_test_exit.r b/scripts/experiments/tunnel_community/speed_test_exit.r similarity index 100% rename from experiment/tunnel_community/speed_test_exit.r rename to scripts/experiments/tunnel_community/speed_test_exit.r diff --git a/src/seedbox/README.md b/scripts/seedbox/README.md similarity index 95% rename from src/seedbox/README.md rename to scripts/seedbox/README.md index 94c3771b73e..03ae9e4f940 100644 --- a/src/seedbox/README.md +++ b/scripts/seedbox/README.md @@ -18,9 +18,9 @@ The seedbox consists of two parts: python3 -m pip install -r requirements.txt ``` 1. Add necessary folders to `PYTHONPATH` (below the bash example) - ```shell - export PYTHONPATH=${PYTHONPATH}:`echo ../.. ../{pyipv8,tribler-core} | tr " " :` - ``` + ```shell + export PYTHONPATH=${PYTHONPATH}:../../../src + ``` ## Torrent seeding diff --git a/src/seedbox/disseminator.py b/scripts/seedbox/disseminator.py similarity index 90% rename from src/seedbox/disseminator.py rename to scripts/seedbox/disseminator.py index 7c52076f67b..155e8cc6c84 100644 --- a/src/seedbox/disseminator.py +++ b/scripts/seedbox/disseminator.py @@ -27,18 +27,18 @@ import sentry_sdk from pony.orm import db_session -from tribler_core.components.gigachannel.gigachannel_component import GigaChannelComponent -from tribler_core.components.gigachannel_manager.gigachannel_manager_component import GigachannelManagerComponent -from tribler_core.components.ipv8.ipv8_component import Ipv8Component -from tribler_core.components.libtorrent.libtorrent_component import LibtorrentComponent -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import NEW -from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent -from tribler_core.components.restapi.restapi_component import RESTComponent -from tribler_core.components.socks_servers.socks_servers_component import SocksServersComponent -from tribler_core.config.tribler_config import TriblerConfig -from tribler_core.components.libtorrent.torrentdef import TorrentDef -from tribler_core.utilities.tiny_tribler_service import TinyTriblerService +from tribler.core.components.gigachannel.gigachannel_component import GigaChannelComponent +from tribler.core.components.gigachannel_manager.gigachannel_manager_component import GigachannelManagerComponent +from tribler.core.components.ipv8.ipv8_component import Ipv8Component +from tribler.core.components.libtorrent.libtorrent_component import LibtorrentComponent +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import NEW +from tribler.core.components.metadata_store.metadata_store_component import MetadataStoreComponent +from tribler.core.components.restapi.restapi_component import RESTComponent +from tribler.core.components.socks_servers.socks_servers_component import SocksServersComponent +from tribler.core.config.tribler_config import TriblerConfig +from tribler.core.components.libtorrent.torrentdef import TorrentDef +from tribler.core.utilities.tiny_tribler_service import TinyTriblerService # fmt: off # flake8: noqa diff --git a/src/seedbox/generate_test_data.py b/scripts/seedbox/generate_test_data.py similarity index 100% rename from src/seedbox/generate_test_data.py rename to scripts/seedbox/generate_test_data.py diff --git a/src/seedbox/requirements.txt b/scripts/seedbox/requirements.txt similarity index 100% rename from src/seedbox/requirements.txt rename to scripts/seedbox/requirements.txt diff --git a/src/seedbox/seeder.py b/scripts/seedbox/seeder.py similarity index 100% rename from src/seedbox/seeder.py rename to scripts/seedbox/seeder.py diff --git a/src/README.md b/src/README.md index 1ed3d5ee415..444a8af2993 100644 --- a/src/README.md +++ b/src/README.md @@ -25,17 +25,11 @@ from` requirements.txt`. ## -Export to PYTHONPATH the following directories: +Export the `src` directory to `PYTHONPATH` -* tribler-core -* tribler-gui - -Shortcut for macOS: -```shell script -export PYTHONPATH=${PYTHONPATH}:`echo {pyipv8,tribler-core,tribler-gui} | tr " " :` -``` Execute: ``` -python3 -m pytest tribler-core -python3 -m pytest tribler-gui --guitests +python3 -m pytest src +python3 -m pytest src --no_parallel +python3 -m pytest src --guitests ``` \ No newline at end of file diff --git a/src/requirements.txt b/src/requirements.txt deleted file mode 100644 index 1bd5ff73f12..00000000000 --- a/src/requirements.txt +++ /dev/null @@ -1 +0,0 @@ --r tribler-gui/tribler_gui/requirements.txt diff --git a/src/run_tests.bat b/src/run_tests.bat deleted file mode 100644 index b754d844391..00000000000 --- a/src/run_tests.bat +++ /dev/null @@ -1,2 +0,0 @@ -set PYTHONPATH=%~dp0tribler-core -pytest %~dp0tribler-core %* diff --git a/src/run_tests.sh b/src/run_tests.sh deleted file mode 100755 index 9ee008258ff..00000000000 --- a/src/run_tests.sh +++ /dev/null @@ -1,8 +0,0 @@ -script_path() { - DIR="${1%/*}" - (cd "$DIR" && echo "$(pwd -P)") -} - -SRC_DIR="$(dirname "$(script_path "$0")")/src" -export PYTHONPATH=$SRC_DIR/tribler-core -pytest $SRC_DIR/tribler-core "$@" diff --git a/src/run_tribler.bat b/src/run_tribler.bat index 21a8d148ae2..983d7becc62 100644 --- a/src/run_tribler.bat +++ b/src/run_tribler.bat @@ -1,2 +1 @@ -set PYTHONPATH=%~dp0tribler-core;%~dp0tribler-gui;%~dp0pyipv8;%~dp0anydex python run_tribler.py diff --git a/src/run_tribler.py b/src/run_tribler.py index 1222740e011..dc556d4fbf4 100644 --- a/src/run_tribler.py +++ b/src/run_tribler.py @@ -8,9 +8,9 @@ import os import sys -from tribler_core.components.reporter.exception_handler import default_core_exception_handler -from tribler_core.sentry_reporter.sentry_reporter import SentryStrategy -from tribler_core.sentry_reporter.sentry_scrubber import SentryScrubber +from tribler.core.components.reporter.exception_handler import default_core_exception_handler +from tribler.core.sentry_reporter.sentry_reporter import SentryStrategy +from tribler.core.sentry_reporter.sentry_scrubber import SentryScrubber logger = logging.getLogger(__name__) @@ -35,7 +35,7 @@ def init_sentry_reporter(): test mode """ sentry_reporter = default_core_exception_handler.sentry_reporter - from tribler_core.version import sentry_url, version_id + from tribler.core.version import sentry_url, version_id test_sentry_url = sentry_reporter.get_test_sentry_url() if not test_sentry_url: @@ -66,7 +66,7 @@ def init_boot_logger(): logger.info(f'Run Tribler: {parsed_args}') # Get root state directory (e.g. from environment variable or from system default) - from tribler_core.utilities.osutils import get_root_state_directory + from tribler.core.utilities.osutils import get_root_state_directory root_state_dir = get_root_state_directory() logger.info(f'Root state dir: {root_state_dir}') @@ -76,10 +76,10 @@ def init_boot_logger(): # Check whether we need to start the core or the user interface if parsed_args.core: - from tribler_core.start_core import run_core + from tribler.core.start_core import run_core run_core(api_port, api_key, root_state_dir, parsed_args) else: # GUI - from tribler_gui.start_gui import run_gui + from tribler.gui.start_gui import run_gui run_gui(api_port, api_key, root_state_dir, parsed_args) diff --git a/src/tribler-core/run_tribler_headless.py b/src/run_tribler_headless.py similarity index 94% rename from src/tribler-core/run_tribler_headless.py rename to src/run_tribler_headless.py index 5e8abaff1cc..74cd7e5ba17 100644 --- a/src/tribler-core/run_tribler_headless.py +++ b/src/run_tribler_headless.py @@ -11,11 +11,11 @@ from datetime import date from socket import inet_aton -from tribler_core.config.tribler_config import TriblerConfig -from tribler_core.start_core import Session -from tribler_core.utilities.osutils import get_appstate_dir, get_root_state_directory -from tribler_core.utilities.path_util import Path -from tribler_core.utilities.process_checker import ProcessChecker +from tribler.core.config.tribler_config import TriblerConfig +from tribler.core.start_core import Session +from tribler.core.utilities.osutils import get_appstate_dir, get_root_state_directory +from tribler.core.utilities.path_util import Path +from tribler.core.utilities.process_checker import ProcessChecker class IPPortAction(argparse.Action): diff --git a/src/tribler-core/tribler_core/__init__.py b/src/tribler-core/tribler_core/__init__.py deleted file mode 100644 index e36d5716944..00000000000 --- a/src/tribler-core/tribler_core/__init__.py +++ /dev/null @@ -1,11 +0,0 @@ -""" -Tribler is a privacy enhanced BitTorrent client with P2P content discovery. -""" -import os -import sys -from pathlib import Path - -dir_path = Path(__file__).parent.parent.parent - -# Make sure IPv8 can be imported -sys.path.insert(0, os.path.join(dir_path, "pyipv8")) diff --git a/src/tribler-core/tribler_core/components/restapi/rest/root_endpoint.py b/src/tribler-core/tribler_core/components/restapi/rest/root_endpoint.py deleted file mode 100644 index 71284c51249..00000000000 --- a/src/tribler-core/tribler_core/components/restapi/rest/root_endpoint.py +++ /dev/null @@ -1,7 +0,0 @@ -from tribler_core.components.restapi.rest.rest_endpoint import RESTEndpoint -from tribler_core.utilities.utilities import froze_it - - -@froze_it -class RootEndpoint(RESTEndpoint): - pass diff --git a/src/tribler-core/tribler_core/tests/test_start_core.py b/src/tribler-core/tribler_core/tests/test_start_core.py deleted file mode 100644 index c1f21920285..00000000000 --- a/src/tribler-core/tribler_core/tests/test_start_core.py +++ /dev/null @@ -1,19 +0,0 @@ -from unittest.mock import MagicMock, patch - -from tribler_core.start_core import run_tribler_core_session -from tribler_core.utilities.path_util import Path - -# pylint: disable= -# fmt: off - - -@patch('tribler_core.logger.logger.load_logger_config', new=MagicMock()) -@patch('tribler_core.start_core.set_process_priority', new=MagicMock()) -@patch('tribler_core.start_core.check_and_enable_code_tracing', new=MagicMock()) -@patch('asyncio.get_event_loop', new=MagicMock()) -@patch('tribler_core.start_core.TriblerConfig.load', new=MagicMock()) -@patch('tribler_core.start_core.core_session') -def test_start_tribler_core_no_exceptions(mocked_core_session): - # test that base logic of tribler core runs without exceptions - run_tribler_core_session(1, 'key', Path('.'), False) - mocked_core_session.assert_called_once() diff --git a/src/tribler.sh b/src/tribler.sh index 060ca80c1cb..20730c44f13 100755 --- a/src/tribler.sh +++ b/src/tribler.sh @@ -10,7 +10,7 @@ UNAME="$(uname -s)" # Add all required modules to PYTHONPATH SRC_DIR="$(dirname "$(script_path "$0")")/src" -PYTHONPATH="$PYTHONPATH:"$SRC_DIR/pyipv8":"$SRC_DIR/anydex":"$SRC_DIR/tribler-core":"$SRC_DIR/tribler-gui"" +PYTHONPATH="$PYTHONPATH:$SRC_DIR" export PYTHONPATH TRIBLER_SCRIPT=$SRC_DIR/run_tribler.py diff --git a/src/tribler-core/tribler_core/components/__init__.py b/src/tribler/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/__init__.py rename to src/tribler/__init__.py diff --git a/src/tribler/core/__init__.py b/src/tribler/core/__init__.py new file mode 100644 index 00000000000..8e34f23d4a6 --- /dev/null +++ b/src/tribler/core/__init__.py @@ -0,0 +1,3 @@ +""" +Tribler is a privacy enhanced BitTorrent client with P2P content discovery. +""" diff --git a/src/tribler-core/tribler_core/check_os.py b/src/tribler/core/check_os.py similarity index 98% rename from src/tribler-core/tribler_core/check_os.py rename to src/tribler/core/check_os.py index 03ca5d0934d..8827d463ea3 100644 --- a/src/tribler-core/tribler_core/check_os.py +++ b/src/tribler/core/check_os.py @@ -7,8 +7,8 @@ import psutil -from tribler_core.utilities.process_checker import ProcessChecker -from tribler_core.utilities.utilities import show_system_popup +from tribler.core.utilities.process_checker import ProcessChecker +from tribler.core.utilities.utilities import show_system_popup FORCE_RESTART_MESSAGE = "An existing Tribler core process (PID:%s) is already running. \n\n" \ "Do you want to stop the process and do a clean restart instead?" diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/__init__.py b/src/tribler/core/components/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/__init__.py rename to src/tribler/core/components/__init__.py diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/community/__init__.py b/src/tribler/core/components/bandwidth_accounting/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/community/__init__.py rename to src/tribler/core/components/bandwidth_accounting/__init__.py diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/bandwidth_accounting_component.py b/src/tribler/core/components/bandwidth_accounting/bandwidth_accounting_component.py similarity index 87% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/bandwidth_accounting_component.py rename to src/tribler/core/components/bandwidth_accounting/bandwidth_accounting_component.py index c67daeff9c1..a1b144857f3 100644 --- a/src/tribler-core/tribler_core/components/bandwidth_accounting/bandwidth_accounting_component.py +++ b/src/tribler/core/components/bandwidth_accounting/bandwidth_accounting_component.py @@ -1,11 +1,11 @@ -from tribler_core.components.bandwidth_accounting.community.bandwidth_accounting_community import ( +from tribler.core.components.bandwidth_accounting.community.bandwidth_accounting_community import ( BandwidthAccountingCommunity, BandwidthAccountingTestnetCommunity, ) -from tribler_core.components.bandwidth_accounting.db.database import BandwidthDatabase -from tribler_core.components.base import Component -from tribler_core.components.ipv8.ipv8_component import Ipv8Component -from tribler_core.utilities.simpledefs import STATEDIR_DB_DIR +from tribler.core.components.bandwidth_accounting.db.database import BandwidthDatabase +from tribler.core.components.base import Component +from tribler.core.components.ipv8.ipv8_component import Ipv8Component +from tribler.core.utilities.simpledefs import STATEDIR_DB_DIR class BandwidthAccountingComponent(Component): diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/db/__init__.py b/src/tribler/core/components/bandwidth_accounting/community/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/db/__init__.py rename to src/tribler/core/components/bandwidth_accounting/community/__init__.py diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/community/bandwidth_accounting_community.py b/src/tribler/core/components/bandwidth_accounting/community/bandwidth_accounting_community.py similarity index 96% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/community/bandwidth_accounting_community.py rename to src/tribler/core/components/bandwidth_accounting/community/bandwidth_accounting_community.py index a89bee539ef..4c3dd4df1a7 100644 --- a/src/tribler-core/tribler_core/components/bandwidth_accounting/community/bandwidth_accounting_community.py +++ b/src/tribler/core/components/bandwidth_accounting/community/bandwidth_accounting_community.py @@ -9,15 +9,15 @@ from ipv8.requestcache import RequestCache from ipv8.types import Address -from tribler_core.components.bandwidth_accounting.community.cache import BandwidthTransactionSignCache -from tribler_core.components.bandwidth_accounting.community.payload import ( +from tribler.core.components.bandwidth_accounting.community.cache import BandwidthTransactionSignCache +from tribler.core.components.bandwidth_accounting.community.payload import ( BandwidthTransactionPayload, BandwidthTransactionQueryPayload, ) -from tribler_core.components.bandwidth_accounting.db.database import BandwidthDatabase -from tribler_core.components.bandwidth_accounting.db.transaction import BandwidthTransactionData, EMPTY_SIGNATURE -from tribler_core.components.ipv8.tribler_community import TriblerCommunity -from tribler_core.utilities.unicode import hexlify +from tribler.core.components.bandwidth_accounting.db.database import BandwidthDatabase +from tribler.core.components.bandwidth_accounting.db.transaction import BandwidthTransactionData, EMPTY_SIGNATURE +from tribler.core.components.ipv8.tribler_community import TriblerCommunity +from tribler.core.utilities.unicode import hexlify class BandwidthAccountingCommunity(TriblerCommunity): diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/community/cache.py b/src/tribler/core/components/bandwidth_accounting/community/cache.py similarity index 94% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/community/cache.py rename to src/tribler/core/components/bandwidth_accounting/community/cache.py index b28b06c1a83..98b97b429c2 100644 --- a/src/tribler-core/tribler_core/components/bandwidth_accounting/community/cache.py +++ b/src/tribler/core/components/bandwidth_accounting/community/cache.py @@ -4,7 +4,7 @@ from ipv8.requestcache import RandomNumberCache -from tribler_core.components.bandwidth_accounting.db.transaction import BandwidthTransactionData +from tribler.core.components.bandwidth_accounting.db.transaction import BandwidthTransactionData class BandwidthTransactionSignCache(RandomNumberCache): diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/community/payload.py b/src/tribler/core/components/bandwidth_accounting/community/payload.py similarity index 100% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/community/payload.py rename to src/tribler/core/components/bandwidth_accounting/community/payload.py diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/restapi/__init__.py b/src/tribler/core/components/bandwidth_accounting/db/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/restapi/__init__.py rename to src/tribler/core/components/bandwidth_accounting/db/__init__.py diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/db/database.py b/src/tribler/core/components/bandwidth_accounting/db/database.py similarity index 97% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/db/database.py rename to src/tribler/core/components/bandwidth_accounting/db/database.py index 08a28ffbe89..620352f9d36 100644 --- a/src/tribler-core/tribler_core/components/bandwidth_accounting/db/database.py +++ b/src/tribler/core/components/bandwidth_accounting/db/database.py @@ -3,9 +3,9 @@ from pony.orm import Database, count, db_session, select, sum -from tribler_core.components.bandwidth_accounting.db import history, misc, transaction as db_transaction -from tribler_core.components.bandwidth_accounting.db.transaction import BandwidthTransactionData -from tribler_core.utilities.utilities import MEMORY_DB +from tribler.core.components.bandwidth_accounting.db import history, misc, transaction as db_transaction +from tribler.core.components.bandwidth_accounting.db.transaction import BandwidthTransactionData +from tribler.core.utilities.utilities import MEMORY_DB class BandwidthDatabase: diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/db/history.py b/src/tribler/core/components/bandwidth_accounting/db/history.py similarity index 100% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/db/history.py rename to src/tribler/core/components/bandwidth_accounting/db/history.py diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/db/misc.py b/src/tribler/core/components/bandwidth_accounting/db/misc.py similarity index 100% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/db/misc.py rename to src/tribler/core/components/bandwidth_accounting/db/misc.py diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/db/transaction.py b/src/tribler/core/components/bandwidth_accounting/db/transaction.py similarity index 99% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/db/transaction.py rename to src/tribler/core/components/bandwidth_accounting/db/transaction.py index da4255165e7..273dadaeaf7 100644 --- a/src/tribler-core/tribler_core/components/bandwidth_accounting/db/transaction.py +++ b/src/tribler/core/components/bandwidth_accounting/db/transaction.py @@ -17,7 +17,7 @@ from pony.orm import PrimaryKey, Required, db_session -from tribler_core.components.bandwidth_accounting.community.payload import BandwidthTransactionPayload +from tribler.core.components.bandwidth_accounting.community.payload import BandwidthTransactionPayload EMPTY_SIGNATURE = b'0' * 64 diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/tests/__init__.py b/src/tribler/core/components/bandwidth_accounting/restapi/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/tests/__init__.py rename to src/tribler/core/components/bandwidth_accounting/restapi/__init__.py diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/restapi/bandwidth_endpoint.py b/src/tribler/core/components/bandwidth_accounting/restapi/bandwidth_endpoint.py similarity index 91% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/restapi/bandwidth_endpoint.py rename to src/tribler/core/components/bandwidth_accounting/restapi/bandwidth_endpoint.py index 129944b26ea..903acdaf9e0 100644 --- a/src/tribler-core/tribler_core/components/bandwidth_accounting/restapi/bandwidth_endpoint.py +++ b/src/tribler/core/components/bandwidth_accounting/restapi/bandwidth_endpoint.py @@ -6,11 +6,11 @@ from marshmallow.fields import Integer, String -from tribler_core.components.bandwidth_accounting.community.bandwidth_accounting_community import ( +from tribler.core.components.bandwidth_accounting.community.bandwidth_accounting_community import ( BandwidthAccountingCommunity, ) -from tribler_core.components.restapi.rest.rest_endpoint import RESTEndpoint, RESTResponse -from tribler_core.utilities.utilities import froze_it +from tribler.core.components.restapi.rest.rest_endpoint import RESTEndpoint, RESTResponse +from tribler.core.utilities.utilities import froze_it @froze_it diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/settings.py b/src/tribler/core/components/bandwidth_accounting/settings.py similarity index 86% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/settings.py rename to src/tribler/core/components/bandwidth_accounting/settings.py index 1d24dc31ad9..3df107daf12 100644 --- a/src/tribler-core/tribler_core/components/bandwidth_accounting/settings.py +++ b/src/tribler/core/components/bandwidth_accounting/settings.py @@ -1,6 +1,6 @@ from pydantic import Field -from tribler_core.config.tribler_config_section import TriblerConfigSection +from tribler.core.config.tribler_config_section import TriblerConfigSection class BandwidthAccountingSettings(TriblerConfigSection): diff --git a/src/tribler-core/tribler_core/components/gigachannel/__init__.py b/src/tribler/core/components/bandwidth_accounting/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/gigachannel/__init__.py rename to src/tribler/core/components/bandwidth_accounting/tests/__init__.py diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/tests/test_bandwidth_accounting_component.py b/src/tribler/core/components/bandwidth_accounting/tests/test_bandwidth_accounting_component.py similarity index 69% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/tests/test_bandwidth_accounting_component.py rename to src/tribler/core/components/bandwidth_accounting/tests/test_bandwidth_accounting_component.py index 849d5f8acf6..73b41a9c9c0 100644 --- a/src/tribler-core/tribler_core/components/bandwidth_accounting/tests/test_bandwidth_accounting_component.py +++ b/src/tribler/core/components/bandwidth_accounting/tests/test_bandwidth_accounting_component.py @@ -1,9 +1,9 @@ import pytest -from tribler_core.components.bandwidth_accounting.bandwidth_accounting_component import BandwidthAccountingComponent -from tribler_core.components.base import Session -from tribler_core.components.ipv8.ipv8_component import Ipv8Component -from tribler_core.components.key.key_component import KeyComponent +from tribler.core.components.bandwidth_accounting.bandwidth_accounting_component import BandwidthAccountingComponent +from tribler.core.components.base import Session +from tribler.core.components.ipv8.ipv8_component import Ipv8Component +from tribler.core.components.key.key_component import KeyComponent # pylint: disable=protected-access diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/tests/test_bandwidth_endpoint.py b/src/tribler/core/components/bandwidth_accounting/tests/test_bandwidth_endpoint.py similarity index 86% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/tests/test_bandwidth_endpoint.py rename to src/tribler/core/components/bandwidth_accounting/tests/test_bandwidth_endpoint.py index 2070648393e..16753f42ccb 100644 --- a/src/tribler-core/tribler_core/components/bandwidth_accounting/tests/test_bandwidth_endpoint.py +++ b/src/tribler/core/components/bandwidth_accounting/tests/test_bandwidth_endpoint.py @@ -4,15 +4,15 @@ import pytest -from tribler_core.components.bandwidth_accounting.community.bandwidth_accounting_community import ( +from tribler.core.components.bandwidth_accounting.community.bandwidth_accounting_community import ( BandwidthAccountingCommunity, ) -from tribler_core.components.bandwidth_accounting.db.database import BandwidthDatabase -from tribler_core.components.bandwidth_accounting.db.transaction import BandwidthTransactionData, EMPTY_SIGNATURE -from tribler_core.components.bandwidth_accounting.restapi.bandwidth_endpoint import BandwidthEndpoint -from tribler_core.components.bandwidth_accounting.settings import BandwidthAccountingSettings -from tribler_core.components.restapi.rest.base_api_test import do_request -from tribler_core.utilities.unicode import hexlify +from tribler.core.components.bandwidth_accounting.db.database import BandwidthDatabase +from tribler.core.components.bandwidth_accounting.db.transaction import BandwidthTransactionData, EMPTY_SIGNATURE +from tribler.core.components.bandwidth_accounting.restapi.bandwidth_endpoint import BandwidthEndpoint +from tribler.core.components.bandwidth_accounting.settings import BandwidthAccountingSettings +from tribler.core.components.restapi.rest.base_api_test import do_request +from tribler.core.utilities.unicode import hexlify pytestmark = pytest.mark.asyncio diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/tests/test_community.py b/src/tribler/core/components/bandwidth_accounting/tests/test_community.py similarity index 94% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/tests/test_community.py rename to src/tribler/core/components/bandwidth_accounting/tests/test_community.py index 0c83c234d2a..5877dd54371 100644 --- a/src/tribler-core/tribler_core/components/bandwidth_accounting/tests/test_community.py +++ b/src/tribler/core/components/bandwidth_accounting/tests/test_community.py @@ -5,14 +5,14 @@ from ipv8.test.base import TestBase from ipv8.test.mocking.ipv8 import MockIPv8 -from tribler_core.components.bandwidth_accounting.community.bandwidth_accounting_community import ( +from tribler.core.components.bandwidth_accounting.community.bandwidth_accounting_community import ( BandwidthAccountingCommunity, ) -from tribler_core.components.bandwidth_accounting.community.cache import BandwidthTransactionSignCache -from tribler_core.components.bandwidth_accounting.db.database import BandwidthDatabase -from tribler_core.components.bandwidth_accounting.db.transaction import BandwidthTransactionData, EMPTY_SIGNATURE -from tribler_core.components.bandwidth_accounting.settings import BandwidthAccountingSettings -from tribler_core.utilities.utilities import MEMORY_DB +from tribler.core.components.bandwidth_accounting.community.cache import BandwidthTransactionSignCache +from tribler.core.components.bandwidth_accounting.db.database import BandwidthDatabase +from tribler.core.components.bandwidth_accounting.db.transaction import BandwidthTransactionData, EMPTY_SIGNATURE +from tribler.core.components.bandwidth_accounting.settings import BandwidthAccountingSettings +from tribler.core.utilities.utilities import MEMORY_DB class TestBandwidthAccountingCommunity(TestBase): diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/tests/test_database.py b/src/tribler/core/components/bandwidth_accounting/tests/test_database.py similarity index 97% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/tests/test_database.py rename to src/tribler/core/components/bandwidth_accounting/tests/test_database.py index 73eb5c02dd4..e2074338a8c 100644 --- a/src/tribler-core/tribler_core/components/bandwidth_accounting/tests/test_database.py +++ b/src/tribler/core/components/bandwidth_accounting/tests/test_database.py @@ -6,9 +6,9 @@ import pytest -from tribler_core.components.bandwidth_accounting.db.database import BandwidthDatabase -from tribler_core.components.bandwidth_accounting.db.transaction import BandwidthTransactionData, EMPTY_SIGNATURE -from tribler_core.utilities.utilities import MEMORY_DB +from tribler.core.components.bandwidth_accounting.db.database import BandwidthDatabase +from tribler.core.components.bandwidth_accounting.db.transaction import BandwidthTransactionData, EMPTY_SIGNATURE +from tribler.core.utilities.utilities import MEMORY_DB @pytest.fixture diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/tests/test_transaction.py b/src/tribler/core/components/bandwidth_accounting/tests/test_transaction.py similarity index 95% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/tests/test_transaction.py rename to src/tribler/core/components/bandwidth_accounting/tests/test_transaction.py index c9f0698bfda..43af80b07db 100644 --- a/src/tribler-core/tribler_core/components/bandwidth_accounting/tests/test_transaction.py +++ b/src/tribler/core/components/bandwidth_accounting/tests/test_transaction.py @@ -1,6 +1,6 @@ from ipv8.keyvault.crypto import default_eccrypto -from tribler_core.components.bandwidth_accounting.db.transaction import BandwidthTransactionData, EMPTY_SIGNATURE +from tribler.core.components.bandwidth_accounting.db.transaction import BandwidthTransactionData, EMPTY_SIGNATURE def test_sign_transaction(): diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/trust_calculation/__init__.py b/src/tribler/core/components/bandwidth_accounting/trust_calculation/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/trust_calculation/__init__.py rename to src/tribler/core/components/bandwidth_accounting/trust_calculation/__init__.py diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/trust_calculation/graph_positioning.py b/src/tribler/core/components/bandwidth_accounting/trust_calculation/graph_positioning.py similarity index 100% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/trust_calculation/graph_positioning.py rename to src/tribler/core/components/bandwidth_accounting/trust_calculation/graph_positioning.py diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/trust_calculation/test_graph_positioning.py b/src/tribler/core/components/bandwidth_accounting/trust_calculation/test_graph_positioning.py similarity index 90% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/trust_calculation/test_graph_positioning.py rename to src/tribler/core/components/bandwidth_accounting/trust_calculation/test_graph_positioning.py index dc29cbf8025..3d2349bcb14 100644 --- a/src/tribler-core/tribler_core/components/bandwidth_accounting/trust_calculation/test_graph_positioning.py +++ b/src/tribler/core/components/bandwidth_accounting/trust_calculation/test_graph_positioning.py @@ -2,7 +2,7 @@ import pytest -from tribler_core.components.bandwidth_accounting.trust_calculation.graph_positioning import GraphPositioning +from tribler.core.components.bandwidth_accounting.trust_calculation.graph_positioning import GraphPositioning def test_graph_positioning_not_tree(): diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/trust_calculation/trust_graph.py b/src/tribler/core/components/bandwidth_accounting/trust_calculation/trust_graph.py similarity index 96% rename from src/tribler-core/tribler_core/components/bandwidth_accounting/trust_calculation/trust_graph.py rename to src/tribler/core/components/bandwidth_accounting/trust_calculation/trust_graph.py index a1f199e2f8f..fb1a1a37abb 100644 --- a/src/tribler-core/tribler_core/components/bandwidth_accounting/trust_calculation/trust_graph.py +++ b/src/tribler/core/components/bandwidth_accounting/trust_calculation/trust_graph.py @@ -4,9 +4,9 @@ import networkx as nx -from tribler_core.exceptions import TrustGraphException -from tribler_core.components.bandwidth_accounting.trust_calculation.graph_positioning import GraphPositioning -from tribler_core.utilities.unicode import hexlify +from tribler.core.exceptions import TrustGraphException +from tribler.core.components.bandwidth_accounting.trust_calculation.graph_positioning import GraphPositioning +from tribler.core.utilities.unicode import hexlify MAX_NODES = 500 MAX_TRANSACTIONS = 2500 diff --git a/src/tribler-core/tribler_core/components/base.py b/src/tribler/core/components/base.py similarity index 96% rename from src/tribler-core/tribler_core/components/base.py rename to src/tribler/core/components/base.py index 3b1bcac44b1..d1a2d75875f 100644 --- a/src/tribler-core/tribler_core/components/base.py +++ b/src/tribler/core/components/base.py @@ -9,12 +9,12 @@ from pathlib import Path from typing import Dict, List, Optional, Set, Type, TypeVar, Union -from tribler_core.config.tribler_config import TriblerConfig -from tribler_core.utilities.crypto_patcher import patch_crypto_be_discovery -from tribler_core.utilities.install_dir import get_lib_path -from tribler_core.utilities.network_utils import default_network_utils -from tribler_core.utilities.notifier import Notifier -from tribler_core.utilities.simpledefs import STATEDIR_CHANNELS_DIR, STATEDIR_DB_DIR +from tribler.core.config.tribler_config import TriblerConfig +from tribler.core.utilities.crypto_patcher import patch_crypto_be_discovery +from tribler.core.utilities.install_dir import get_lib_path +from tribler.core.utilities.network_utils import default_network_utils +from tribler.core.utilities.notifier import Notifier +from tribler.core.utilities.simpledefs import STATEDIR_CHANNELS_DIR, STATEDIR_DB_DIR class SessionError(Exception): diff --git a/src/tribler-core/tribler_core/components/gigachannel/community/__init__.py b/src/tribler/core/components/gigachannel/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/gigachannel/community/__init__.py rename to src/tribler/core/components/gigachannel/__init__.py diff --git a/src/tribler-core/tribler_core/components/gigachannel/community/tests/__init__.py b/src/tribler/core/components/gigachannel/community/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/gigachannel/community/tests/__init__.py rename to src/tribler/core/components/gigachannel/community/__init__.py diff --git a/src/tribler-core/tribler_core/components/gigachannel/community/gigachannel_community.py b/src/tribler/core/components/gigachannel/community/gigachannel_community.py similarity index 95% rename from src/tribler-core/tribler_core/components/gigachannel/community/gigachannel_community.py rename to src/tribler/core/components/gigachannel/community/gigachannel_community.py index fd3f523a2ac..ac194153d06 100644 --- a/src/tribler-core/tribler_core/components/gigachannel/community/gigachannel_community.py +++ b/src/tribler/core/components/gigachannel/community/gigachannel_community.py @@ -10,15 +10,15 @@ from pony.orm import db_session -from tribler_core import notifications -from tribler_core.components.ipv8.discovery_booster import DiscoveryBooster -from tribler_core.components.metadata_store.db.serialization import CHANNEL_TORRENT -from tribler_core.components.metadata_store.remote_query_community.payload_checker import ObjState -from tribler_core.components.metadata_store.remote_query_community.remote_query_community import RemoteQueryCommunity -from tribler_core.components.metadata_store.utils import NoChannelSourcesException -from tribler_core.utilities.notifier import Notifier -from tribler_core.utilities.simpledefs import CHANNELS_VIEW_UUID -from tribler_core.utilities.unicode import hexlify +from tribler.core import notifications +from tribler.core.components.ipv8.discovery_booster import DiscoveryBooster +from tribler.core.components.metadata_store.db.serialization import CHANNEL_TORRENT +from tribler.core.components.metadata_store.remote_query_community.payload_checker import ObjState +from tribler.core.components.metadata_store.remote_query_community.remote_query_community import RemoteQueryCommunity +from tribler.core.components.metadata_store.utils import NoChannelSourcesException +from tribler.core.utilities.notifier import Notifier +from tribler.core.utilities.simpledefs import CHANNELS_VIEW_UUID +from tribler.core.utilities.unicode import hexlify minimal_blob_size = 200 maximum_payload_size = 1024 diff --git a/src/tribler-core/tribler_core/components/gigachannel/community/request.py b/src/tribler/core/components/gigachannel/community/request.py similarity index 93% rename from src/tribler-core/tribler_core/components/gigachannel/community/request.py rename to src/tribler/core/components/gigachannel/community/request.py index 5749bab023b..970345e5006 100644 --- a/src/tribler-core/tribler_core/components/gigachannel/community/request.py +++ b/src/tribler/core/components/gigachannel/community/request.py @@ -1,6 +1,6 @@ from ipv8.requestcache import RandomNumberCache -from tribler_core.utilities.unicode import hexlify +from tribler.core.utilities.unicode import hexlify class SearchRequestCache(RandomNumberCache): diff --git a/src/tribler-core/tribler_core/components/gigachannel/community/settings.py b/src/tribler/core/components/gigachannel/community/settings.py similarity index 79% rename from src/tribler-core/tribler_core/components/gigachannel/community/settings.py rename to src/tribler/core/components/gigachannel/community/settings.py index d33306c4f74..88520fccb96 100644 --- a/src/tribler-core/tribler_core/components/gigachannel/community/settings.py +++ b/src/tribler/core/components/gigachannel/community/settings.py @@ -1,7 +1,7 @@ from pydantic import Field -from tribler_core.config.tribler_config_section import TriblerConfigSection -from tribler_core.utilities.simpledefs import STATEDIR_CHANNELS_DIR +from tribler.core.config.tribler_config_section import TriblerConfigSection +from tribler.core.utilities.simpledefs import STATEDIR_CHANNELS_DIR class ChantSettings(TriblerConfigSection): diff --git a/src/tribler-core/tribler_core/components/gigachannel/community/sync_strategy.py b/src/tribler/core/components/gigachannel/community/sync_strategy.py similarity index 100% rename from src/tribler-core/tribler_core/components/gigachannel/community/sync_strategy.py rename to src/tribler/core/components/gigachannel/community/sync_strategy.py diff --git a/src/tribler-core/tribler_core/components/gigachannel_manager/__init__.py b/src/tribler/core/components/gigachannel/community/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/gigachannel_manager/__init__.py rename to src/tribler/core/components/gigachannel/community/tests/__init__.py diff --git a/src/tribler-core/tribler_core/components/gigachannel/community/tests/test_gigachannel_community.py b/src/tribler/core/components/gigachannel/community/tests/test_gigachannel_community.py similarity index 96% rename from src/tribler-core/tribler_core/components/gigachannel/community/tests/test_gigachannel_community.py rename to src/tribler/core/components/gigachannel/community/tests/test_gigachannel_community.py index e3edc981659..77005b527a0 100644 --- a/src/tribler-core/tribler_core/components/gigachannel/community/tests/test_gigachannel_community.py +++ b/src/tribler/core/components/gigachannel/community/tests/test_gigachannel_community.py @@ -10,24 +10,24 @@ import pytest -from tribler_core.components.gigachannel.community.gigachannel_community import ( +from tribler.core.components.gigachannel.community.gigachannel_community import ( ChannelsPeersMapping, GigaChannelCommunity, NoChannelSourcesException, ) -from tribler_core.components.gigachannel.community.settings import ChantSettings -from tribler_core.components.metadata_store.db.store import MetadataStore -from tribler_core.components.metadata_store.remote_query_community.settings import RemoteQueryCommunitySettings -from tribler_core.components.metadata_store.utils import RequestTimeoutException -from tribler_core.utilities.notifier import Notifier -from tribler_core.utilities.path_util import Path -from tribler_core.utilities.utilities import random_infohash +from tribler.core.components.gigachannel.community.settings import ChantSettings +from tribler.core.components.metadata_store.db.store import MetadataStore +from tribler.core.components.metadata_store.remote_query_community.settings import RemoteQueryCommunitySettings +from tribler.core.components.metadata_store.utils import RequestTimeoutException +from tribler.core.utilities.notifier import Notifier +from tribler.core.utilities.path_util import Path +from tribler.core.utilities.utilities import random_infohash EMPTY_BLOB = b"" # pylint:disable=protected-access -BASE_PATH = 'tribler_core.components.metadata_store.remote_query_community.remote_query_community' +BASE_PATH = 'tribler.core.components.metadata_store.remote_query_community.remote_query_community' class TestGigaChannelUnits(TestBase): @@ -54,7 +54,7 @@ def create_node(self, *args, **kwargs): kwargs['metadata_store'] = metadata_store kwargs['settings'] = ChantSettings() kwargs['rqc_settings'] = RemoteQueryCommunitySettings() - with patch('tribler_core.components.gigachannel.community.gigachannel_community.DiscoveryBooster'): + with patch('tribler.core.components.gigachannel.community.gigachannel_community.DiscoveryBooster'): node = super().create_node(*args, **kwargs) self.count += 1 return node diff --git a/src/tribler-core/tribler_core/components/gigachannel/community/tests/test_sync_strategy.py b/src/tribler/core/components/gigachannel/community/tests/test_sync_strategy.py similarity index 96% rename from src/tribler-core/tribler_core/components/gigachannel/community/tests/test_sync_strategy.py rename to src/tribler/core/components/gigachannel/community/tests/test_sync_strategy.py index b8ff9e2350b..b770d9283e7 100644 --- a/src/tribler-core/tribler_core/components/gigachannel/community/tests/test_sync_strategy.py +++ b/src/tribler/core/components/gigachannel/community/tests/test_sync_strategy.py @@ -3,7 +3,7 @@ from ipv8.peerdiscovery.network import Network from ipv8.test.base import TestBase -from tribler_core.components.gigachannel.community.sync_strategy import RemovePeers +from tribler.core.components.gigachannel.community.sync_strategy import RemovePeers class MockCommunity: diff --git a/src/tribler-core/tribler_core/components/gigachannel/gigachannel_component.py b/src/tribler/core/components/gigachannel/gigachannel_component.py similarity index 79% rename from src/tribler-core/tribler_core/components/gigachannel/gigachannel_component.py rename to src/tribler/core/components/gigachannel/gigachannel_component.py index 968c0381af9..ac173d066bf 100644 --- a/src/tribler-core/tribler_core/components/gigachannel/gigachannel_component.py +++ b/src/tribler/core/components/gigachannel/gigachannel_component.py @@ -1,15 +1,15 @@ from ipv8.peerdiscovery.network import Network -from tribler_core.components.base import Component -from tribler_core.components.gigachannel.community.gigachannel_community import ( +from tribler.core.components.base import Component +from tribler.core.components.gigachannel.community.gigachannel_community import ( GigaChannelCommunity, GigaChannelTestnetCommunity, ) -from tribler_core.components.gigachannel.community.sync_strategy import RemovePeers -from tribler_core.components.ipv8.ipv8_component import INFINITE, Ipv8Component -from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent -from tribler_core.components.reporter.reporter_component import ReporterComponent -from tribler_core.components.tag.tag_component import TagComponent +from tribler.core.components.gigachannel.community.sync_strategy import RemovePeers +from tribler.core.components.ipv8.ipv8_component import INFINITE, Ipv8Component +from tribler.core.components.metadata_store.metadata_store_component import MetadataStoreComponent +from tribler.core.components.reporter.reporter_component import ReporterComponent +from tribler.core.components.tag.tag_component import TagComponent class GigaChannelComponent(Component): diff --git a/src/tribler-core/tribler_core/components/gigachannel/tests/test_gigachannel_component.py b/src/tribler/core/components/gigachannel/tests/test_gigachannel_component.py similarity index 65% rename from src/tribler-core/tribler_core/components/gigachannel/tests/test_gigachannel_component.py rename to src/tribler/core/components/gigachannel/tests/test_gigachannel_component.py index 423f8fa823e..9390368de33 100644 --- a/src/tribler-core/tribler_core/components/gigachannel/tests/test_gigachannel_component.py +++ b/src/tribler/core/components/gigachannel/tests/test_gigachannel_component.py @@ -1,11 +1,11 @@ import pytest -from tribler_core.components.base import Session -from tribler_core.components.gigachannel.gigachannel_component import GigaChannelComponent -from tribler_core.components.ipv8.ipv8_component import Ipv8Component -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent -from tribler_core.components.tag.tag_component import TagComponent +from tribler.core.components.base import Session +from tribler.core.components.gigachannel.gigachannel_component import GigaChannelComponent +from tribler.core.components.ipv8.ipv8_component import Ipv8Component +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.metadata_store.metadata_store_component import MetadataStoreComponent +from tribler.core.components.tag.tag_component import TagComponent # pylint: disable=protected-access diff --git a/src/tribler-core/tribler_core/components/gigachannel_manager/tests/__init__.py b/src/tribler/core/components/gigachannel_manager/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/gigachannel_manager/tests/__init__.py rename to src/tribler/core/components/gigachannel_manager/__init__.py diff --git a/src/tribler-core/tribler_core/components/gigachannel_manager/gigachannel_manager.py b/src/tribler/core/components/gigachannel_manager/gigachannel_manager.py similarity index 96% rename from src/tribler-core/tribler_core/components/gigachannel_manager/gigachannel_manager.py rename to src/tribler/core/components/gigachannel_manager/gigachannel_manager.py index a1b69686d89..b9496d948ee 100644 --- a/src/tribler-core/tribler_core/components/gigachannel_manager/gigachannel_manager.py +++ b/src/tribler/core/components/gigachannel_manager/gigachannel_manager.py @@ -6,16 +6,16 @@ from pony.orm import db_session -from tribler_core import notifications -from tribler_core.components.libtorrent.download_manager.download_config import DownloadConfig -from tribler_core.components.libtorrent.download_manager.download_manager import DownloadManager -from tribler_core.components.libtorrent.torrentdef import TorrentDef -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import COMMITTED -from tribler_core.components.metadata_store.db.serialization import CHANNEL_TORRENT -from tribler_core.components.metadata_store.db.store import MetadataStore -from tribler_core.utilities.notifier import Notifier -from tribler_core.utilities.simpledefs import DLSTATUS_SEEDING, NTFY -from tribler_core.utilities.unicode import hexlify +from tribler.core import notifications +from tribler.core.components.libtorrent.download_manager.download_config import DownloadConfig +from tribler.core.components.libtorrent.download_manager.download_manager import DownloadManager +from tribler.core.components.libtorrent.torrentdef import TorrentDef +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import COMMITTED +from tribler.core.components.metadata_store.db.serialization import CHANNEL_TORRENT +from tribler.core.components.metadata_store.db.store import MetadataStore +from tribler.core.utilities.notifier import Notifier +from tribler.core.utilities.simpledefs import DLSTATUS_SEEDING, NTFY +from tribler.core.utilities.unicode import hexlify PROCESS_CHANNEL_DIR = 1 REMOVE_CHANNEL_DOWNLOAD = 2 diff --git a/src/tribler-core/tribler_core/components/gigachannel_manager/gigachannel_manager_component.py b/src/tribler/core/components/gigachannel_manager/gigachannel_manager_component.py similarity index 80% rename from src/tribler-core/tribler_core/components/gigachannel_manager/gigachannel_manager_component.py rename to src/tribler/core/components/gigachannel_manager/gigachannel_manager_component.py index 97d6276137a..9717196ec2d 100644 --- a/src/tribler-core/tribler_core/components/gigachannel_manager/gigachannel_manager_component.py +++ b/src/tribler/core/components/gigachannel_manager/gigachannel_manager_component.py @@ -1,7 +1,7 @@ -from tribler_core.components.base import Component -from tribler_core.components.gigachannel_manager.gigachannel_manager import GigaChannelManager -from tribler_core.components.libtorrent.libtorrent_component import LibtorrentComponent -from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent +from tribler.core.components.base import Component +from tribler.core.components.gigachannel_manager.gigachannel_manager import GigaChannelManager +from tribler.core.components.libtorrent.libtorrent_component import LibtorrentComponent +from tribler.core.components.metadata_store.metadata_store_component import MetadataStoreComponent class GigachannelManagerComponent(Component): diff --git a/src/tribler-core/tribler_core/components/ipv8/__init__.py b/src/tribler/core/components/gigachannel_manager/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/ipv8/__init__.py rename to src/tribler/core/components/gigachannel_manager/tests/__init__.py diff --git a/src/tribler-core/tribler_core/components/gigachannel_manager/tests/test_gigachannel_manager.py b/src/tribler/core/components/gigachannel_manager/tests/test_gigachannel_manager.py similarity index 96% rename from src/tribler-core/tribler_core/components/gigachannel_manager/tests/test_gigachannel_manager.py rename to src/tribler/core/components/gigachannel_manager/tests/test_gigachannel_manager.py index c2c5d79ae80..ca3ceed54fe 100644 --- a/src/tribler-core/tribler_core/components/gigachannel_manager/tests/test_gigachannel_manager.py +++ b/src/tribler/core/components/gigachannel_manager/tests/test_gigachannel_manager.py @@ -10,13 +10,13 @@ import pytest -from tribler_core.components.gigachannel_manager.gigachannel_manager import GigaChannelManager -from tribler_core.components.libtorrent.torrentdef import TorrentDef -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import NEW -from tribler_core.tests.tools.base_test import MockObject -from tribler_core.tests.tools.common import TORRENT_UBUNTU_FILE -from tribler_core.utilities.simpledefs import DLSTATUS_SEEDING -from tribler_core.utilities.utilities import random_infohash +from tribler.core.components.gigachannel_manager.gigachannel_manager import GigaChannelManager +from tribler.core.components.libtorrent.torrentdef import TorrentDef +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import NEW +from tribler.core.tests.tools.base_test import MockObject +from tribler.core.tests.tools.common import TORRENT_UBUNTU_FILE +from tribler.core.utilities.simpledefs import DLSTATUS_SEEDING +from tribler.core.utilities.utilities import random_infohash update_metainfo = None @@ -103,7 +103,7 @@ async def mock_remove_download(download_obj, **_): # Test regenerating a non-empty channel gigachannel_manager.updated_my_channel = MagicMock() metadata_store.ChannelMetadata.consolidate_channel_torrent = lambda *_: MagicMock() - with patch("tribler_core.components.libtorrent.torrentdef.TorrentDef.load_from_dict"): + with patch("tribler.core.components.libtorrent.torrentdef.TorrentDef.load_from_dict"): await gigachannel_manager.regenerate_channel_torrent(chan_pk, chan_id) gigachannel_manager.updated_my_channel.assert_called_once() diff --git a/src/tribler-core/tribler_core/components/gigachannel_manager/tests/test_gigachannel_manager_component.py b/src/tribler/core/components/gigachannel_manager/tests/test_gigachannel_manager_component.py similarity index 59% rename from src/tribler-core/tribler_core/components/gigachannel_manager/tests/test_gigachannel_manager_component.py rename to src/tribler/core/components/gigachannel_manager/tests/test_gigachannel_manager_component.py index fab1a457ca4..b467fafdd70 100644 --- a/src/tribler-core/tribler_core/components/gigachannel_manager/tests/test_gigachannel_manager_component.py +++ b/src/tribler/core/components/gigachannel_manager/tests/test_gigachannel_manager_component.py @@ -1,13 +1,13 @@ import pytest -from tribler_core.components.base import Session -from tribler_core.components.gigachannel_manager.gigachannel_manager_component import GigachannelManagerComponent -from tribler_core.components.ipv8.ipv8_component import Ipv8Component -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.libtorrent.libtorrent_component import LibtorrentComponent -from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent -from tribler_core.components.socks_servers.socks_servers_component import SocksServersComponent -from tribler_core.components.tag.tag_component import TagComponent +from tribler.core.components.base import Session +from tribler.core.components.gigachannel_manager.gigachannel_manager_component import GigachannelManagerComponent +from tribler.core.components.ipv8.ipv8_component import Ipv8Component +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.libtorrent.libtorrent_component import LibtorrentComponent +from tribler.core.components.metadata_store.metadata_store_component import MetadataStoreComponent +from tribler.core.components.socks_servers.socks_servers_component import SocksServersComponent +from tribler.core.components.tag.tag_component import TagComponent # pylint: disable=protected-access diff --git a/src/tribler-core/tribler_core/components/ipv8/tests/__init__.py b/src/tribler/core/components/ipv8/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/ipv8/tests/__init__.py rename to src/tribler/core/components/ipv8/__init__.py diff --git a/src/tribler-core/tribler_core/components/ipv8/discovery_booster.py b/src/tribler/core/components/ipv8/discovery_booster.py similarity index 100% rename from src/tribler-core/tribler_core/components/ipv8/discovery_booster.py rename to src/tribler/core/components/ipv8/discovery_booster.py diff --git a/src/tribler-core/tribler_core/components/ipv8/eva_protocol.py b/src/tribler/core/components/ipv8/eva_protocol.py similarity index 100% rename from src/tribler-core/tribler_core/components/ipv8/eva_protocol.py rename to src/tribler/core/components/ipv8/eva_protocol.py diff --git a/src/tribler-core/tribler_core/components/ipv8/ipv8_component.py b/src/tribler/core/components/ipv8/ipv8_component.py similarity index 97% rename from src/tribler-core/tribler_core/components/ipv8/ipv8_component.py rename to src/tribler/core/components/ipv8/ipv8_component.py index ae8a241bded..132d258236d 100644 --- a/src/tribler-core/tribler_core/components/ipv8/ipv8_component.py +++ b/src/tribler/core/components/ipv8/ipv8_component.py @@ -15,8 +15,8 @@ from ipv8_service import IPv8 -from tribler_core.components.base import Component -from tribler_core.components.key.key_component import KeyComponent +from tribler.core.components.base import Component +from tribler.core.components.key.key_component import KeyComponent INFINITE = -1 @@ -73,7 +73,7 @@ async def run(self): ipv8.endpoint.enable_community_statistics(overlay.get_prefix(), True) if config.ipv8.walk_scaling_enabled and not config.gui_test_mode: - from tribler_core.components.ipv8.ipv8_health_monitor import IPv8Monitor + from tribler.core.components.ipv8.ipv8_health_monitor import IPv8Monitor IPv8Monitor(ipv8, config.ipv8.walk_interval, config.ipv8.walk_scaling_upper_limit).start(self._task_manager) diff --git a/src/tribler-core/tribler_core/components/ipv8/ipv8_health_monitor.py b/src/tribler/core/components/ipv8/ipv8_health_monitor.py similarity index 100% rename from src/tribler-core/tribler_core/components/ipv8/ipv8_health_monitor.py rename to src/tribler/core/components/ipv8/ipv8_health_monitor.py diff --git a/src/tribler-core/tribler_core/components/ipv8/settings.py b/src/tribler/core/components/ipv8/settings.py similarity index 87% rename from src/tribler-core/tribler_core/components/ipv8/settings.py rename to src/tribler/core/components/ipv8/settings.py index 391c594ea5b..446b60211f5 100644 --- a/src/tribler-core/tribler_core/components/ipv8/settings.py +++ b/src/tribler/core/components/ipv8/settings.py @@ -2,8 +2,8 @@ from pydantic import validator -from tribler_core.config.tribler_config_section import TriblerConfigSection -from tribler_core.utilities.network_utils import NetworkUtils +from tribler.core.config.tribler_config_section import TriblerConfigSection +from tribler.core.utilities.network_utils import NetworkUtils # pylint: disable=no-self-argument diff --git a/src/tribler-core/tribler_core/components/key/__init__.py b/src/tribler/core/components/ipv8/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/key/__init__.py rename to src/tribler/core/components/ipv8/tests/__init__.py diff --git a/src/tribler-core/tribler_core/components/ipv8/tests/test_discovery_booster.py b/src/tribler/core/components/ipv8/tests/test_discovery_booster.py similarity index 96% rename from src/tribler-core/tribler_core/components/ipv8/tests/test_discovery_booster.py rename to src/tribler/core/components/ipv8/tests/test_discovery_booster.py index e62889ca1e2..12c42220588 100644 --- a/src/tribler-core/tribler_core/components/ipv8/tests/test_discovery_booster.py +++ b/src/tribler/core/components/ipv8/tests/test_discovery_booster.py @@ -1,6 +1,6 @@ import pytest -from tribler_core.components.ipv8.discovery_booster import DiscoveryBooster +from tribler.core.components.ipv8.discovery_booster import DiscoveryBooster TEST_BOOSTER_TIMEOUT_IN_SEC = 10 TEST_BOOSTER_TAKE_STEP_INTERVAL_IN_SEC = 1 diff --git a/src/tribler-core/tribler_core/components/ipv8/tests/test_eva_protocol.py b/src/tribler/core/components/ipv8/tests/test_eva_protocol.py similarity index 99% rename from src/tribler-core/tribler_core/components/ipv8/tests/test_eva_protocol.py rename to src/tribler/core/components/ipv8/tests/test_eva_protocol.py index f1f913dfd9c..1aa67b2755d 100644 --- a/src/tribler-core/tribler_core/components/ipv8/tests/test_eva_protocol.py +++ b/src/tribler/core/components/ipv8/tests/test_eva_protocol.py @@ -12,7 +12,7 @@ import pytest -from tribler_core.components.ipv8.eva_protocol import ( +from tribler.core.components.ipv8.eva_protocol import ( Acknowledgement, EVAProtocol, EVAProtocolMixin, diff --git a/src/tribler-core/tribler_core/components/ipv8/tests/test_ipv8_component.py b/src/tribler/core/components/ipv8/tests/test_ipv8_component.py similarity index 88% rename from src/tribler-core/tribler_core/components/ipv8/tests/test_ipv8_component.py rename to src/tribler/core/components/ipv8/tests/test_ipv8_component.py index a553ff4fbf0..6089cd25d60 100644 --- a/src/tribler-core/tribler_core/components/ipv8/tests/test_ipv8_component.py +++ b/src/tribler/core/components/ipv8/tests/test_ipv8_component.py @@ -1,8 +1,8 @@ import pytest -from tribler_core.components.base import Session -from tribler_core.components.ipv8.ipv8_component import Ipv8Component -from tribler_core.components.key.key_component import KeyComponent +from tribler.core.components.base import Session +from tribler.core.components.ipv8.ipv8_component import Ipv8Component +from tribler.core.components.key.key_component import KeyComponent # pylint: disable=protected-access diff --git a/src/tribler-core/tribler_core/components/ipv8/tests/test_ipv8_health_manager.py b/src/tribler/core/components/ipv8/tests/test_ipv8_health_manager.py similarity index 98% rename from src/tribler-core/tribler_core/components/ipv8/tests/test_ipv8_health_manager.py rename to src/tribler/core/components/ipv8/tests/test_ipv8_health_manager.py index 7cbc72f7a3e..47fd740e34b 100644 --- a/src/tribler-core/tribler_core/components/ipv8/tests/test_ipv8_health_manager.py +++ b/src/tribler/core/components/ipv8/tests/test_ipv8_health_manager.py @@ -10,7 +10,7 @@ from ipv8.taskmanager import TaskManager -from tribler_core.components.ipv8.ipv8_health_monitor import IPv8Monitor +from tribler.core.components.ipv8.ipv8_health_monitor import IPv8Monitor DEFAULT_WALK_INTERVAL = 0.5 diff --git a/src/tribler-core/tribler_core/components/ipv8/tribler_community.py b/src/tribler/core/components/ipv8/tribler_community.py similarity index 84% rename from src/tribler-core/tribler_core/components/ipv8/tribler_community.py rename to src/tribler/core/components/ipv8/tribler_community.py index 365dadb3834..018d4ecdd56 100644 --- a/src/tribler-core/tribler_core/components/ipv8/tribler_community.py +++ b/src/tribler/core/components/ipv8/tribler_community.py @@ -1,6 +1,6 @@ from ipv8.community import Community -from tribler_core.config.tribler_config_section import TriblerConfigSection +from tribler.core.config.tribler_config_section import TriblerConfigSection class TriblerCommunity(Community): diff --git a/src/tribler-core/tribler_core/components/libtorrent/__init__.py b/src/tribler/core/components/key/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/libtorrent/__init__.py rename to src/tribler/core/components/key/__init__.py diff --git a/src/tribler-core/tribler_core/components/key/key_component.py b/src/tribler/core/components/key/key_component.py similarity index 90% rename from src/tribler-core/tribler_core/components/key/key_component.py rename to src/tribler/core/components/key/key_component.py index 1fa86f37707..68f99fe5faf 100644 --- a/src/tribler-core/tribler_core/components/key/key_component.py +++ b/src/tribler/core/components/key/key_component.py @@ -1,7 +1,7 @@ from ipv8.keyvault.private.libnaclkey import LibNaCLSK -from tribler_core.components.base import Component -from tribler_core.config.tribler_config import TriblerConfig -from tribler_core.utilities.path_util import Path +from tribler.core.components.base import Component +from tribler.core.config.tribler_config import TriblerConfig +from tribler.core.utilities.path_util import Path class KeyComponent(Component): diff --git a/src/tribler-core/tribler_core/components/key/settings.py b/src/tribler/core/components/key/settings.py similarity index 86% rename from src/tribler-core/tribler_core/components/key/settings.py rename to src/tribler/core/components/key/settings.py index 89d056399f1..ae2502a3b7b 100644 --- a/src/tribler-core/tribler_core/components/key/settings.py +++ b/src/tribler/core/components/key/settings.py @@ -1,6 +1,6 @@ from pydantic import Field -from tribler_core.config.tribler_config_section import TriblerConfigSection +from tribler.core.config.tribler_config_section import TriblerConfigSection # pylint: disable=no-self-argument diff --git a/src/tribler-core/tribler_core/components/key/tests/test_key_component.py b/src/tribler/core/components/key/tests/test_key_component.py similarity index 92% rename from src/tribler-core/tribler_core/components/key/tests/test_key_component.py rename to src/tribler/core/components/key/tests/test_key_component.py index c612c759f0b..33f91e79ba9 100644 --- a/src/tribler-core/tribler_core/components/key/tests/test_key_component.py +++ b/src/tribler/core/components/key/tests/test_key_component.py @@ -1,7 +1,7 @@ import pytest -from tribler_core.components.base import Session -from tribler_core.components.key.key_component import KeyComponent +from tribler.core.components.base import Session +from tribler.core.components.key.key_component import KeyComponent @pytest.mark.asyncio diff --git a/src/tribler-core/tribler_core/components/libtorrent/download_manager/__init__.py b/src/tribler/core/components/libtorrent/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/libtorrent/download_manager/__init__.py rename to src/tribler/core/components/libtorrent/__init__.py diff --git a/src/tribler-core/tribler_core/components/libtorrent/restapi/__init__.py b/src/tribler/core/components/libtorrent/download_manager/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/libtorrent/restapi/__init__.py rename to src/tribler/core/components/libtorrent/download_manager/__init__.py diff --git a/src/tribler-core/tribler_core/components/libtorrent/download_manager/dht_health_manager.py b/src/tribler/core/components/libtorrent/download_manager/dht_health_manager.py similarity index 98% rename from src/tribler-core/tribler_core/components/libtorrent/download_manager/dht_health_manager.py rename to src/tribler/core/components/libtorrent/download_manager/dht_health_manager.py index eec961b2163..e299ac0f645 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/download_manager/dht_health_manager.py +++ b/src/tribler/core/components/libtorrent/download_manager/dht_health_manager.py @@ -3,8 +3,8 @@ from ipv8.taskmanager import TaskManager -from tribler_core.components.libtorrent.utils.libtorrent_helper import libtorrent as lt -from tribler_core.utilities.unicode import hexlify +from tribler.core.components.libtorrent.utils.libtorrent_helper import libtorrent as lt +from tribler.core.utilities.unicode import hexlify class DHTHealthManager(TaskManager): diff --git a/src/tribler-core/tribler_core/components/libtorrent/download_manager/download.py b/src/tribler/core/components/libtorrent/download_manager/download.py similarity index 97% rename from src/tribler-core/tribler_core/components/libtorrent/download_manager/download.py rename to src/tribler/core/components/libtorrent/download_manager/download.py index 55517c0162f..452a0603f20 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/download_manager/download.py +++ b/src/tribler/core/components/libtorrent/download_manager/download.py @@ -12,21 +12,21 @@ from ipv8.taskmanager import TaskManager, task from ipv8.util import int2byte, succeed -from tribler_core import notifications -from tribler_core.components.libtorrent.download_manager.download_config import DownloadConfig -from tribler_core.components.libtorrent.download_manager.download_state import DownloadState -from tribler_core.components.libtorrent.download_manager.stream import Stream -from tribler_core.components.libtorrent.settings import DownloadDefaultsSettings -from tribler_core.components.libtorrent.torrentdef import TorrentDef, TorrentDefNoMetainfo -from tribler_core.components.libtorrent.utils.libtorrent_helper import libtorrent as lt -from tribler_core.components.libtorrent.utils.torrent_utils import check_handle, get_info_from_handle, require_handle -from tribler_core.exceptions import SaveResumeDataError -from tribler_core.utilities.notifier import Notifier -from tribler_core.utilities.osutils import fix_filebasename -from tribler_core.utilities.path_util import Path -from tribler_core.utilities.simpledefs import DLSTATUS_SEEDING, DLSTATUS_STOPPED, DOWNLOAD, NTFY -from tribler_core.utilities.unicode import ensure_unicode, hexlify -from tribler_core.utilities.utilities import bdecode_compat +from tribler.core import notifications +from tribler.core.components.libtorrent.download_manager.download_config import DownloadConfig +from tribler.core.components.libtorrent.download_manager.download_state import DownloadState +from tribler.core.components.libtorrent.download_manager.stream import Stream +from tribler.core.components.libtorrent.settings import DownloadDefaultsSettings +from tribler.core.components.libtorrent.torrentdef import TorrentDef, TorrentDefNoMetainfo +from tribler.core.components.libtorrent.utils.libtorrent_helper import libtorrent as lt +from tribler.core.components.libtorrent.utils.torrent_utils import check_handle, get_info_from_handle, require_handle +from tribler.core.exceptions import SaveResumeDataError +from tribler.core.utilities.notifier import Notifier +from tribler.core.utilities.osutils import fix_filebasename +from tribler.core.utilities.path_util import Path +from tribler.core.utilities.simpledefs import DLSTATUS_SEEDING, DLSTATUS_STOPPED, DOWNLOAD, NTFY +from tribler.core.utilities.unicode import ensure_unicode, hexlify +from tribler.core.utilities.utilities import bdecode_compat class Download(TaskManager): diff --git a/src/tribler-core/tribler_core/components/libtorrent/download_manager/download_config.py b/src/tribler/core/components/libtorrent/download_manager/download_config.py similarity index 94% rename from src/tribler-core/tribler_core/components/libtorrent/download_manager/download_config.py rename to src/tribler/core/components/libtorrent/download_manager/download_config.py index 95bce2fbcb1..85bfe0aa581 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/download_manager/download_config.py +++ b/src/tribler/core/components/libtorrent/download_manager/download_config.py @@ -4,12 +4,12 @@ from validate import Validator -from tribler_core.components.libtorrent.utils.libtorrent_helper import libtorrent as lt -from tribler_core.exceptions import InvalidConfigException -from tribler_core.utilities.install_dir import get_lib_path -from tribler_core.utilities.osutils import get_home_dir -from tribler_core.utilities.path_util import Path -from tribler_core.utilities.utilities import bdecode_compat +from tribler.core.components.libtorrent.utils.libtorrent_helper import libtorrent as lt +from tribler.core.exceptions import InvalidConfigException +from tribler.core.utilities.install_dir import get_lib_path +from tribler.core.utilities.osutils import get_home_dir +from tribler.core.utilities.path_util import Path +from tribler.core.utilities.utilities import bdecode_compat SPEC_FILENAME = 'download_config.spec' CONFIG_SPEC_PATH = get_lib_path() / 'components/libtorrent/download_manager' / SPEC_FILENAME diff --git a/src/tribler-core/tribler_core/components/libtorrent/download_manager/download_config.spec b/src/tribler/core/components/libtorrent/download_manager/download_config.spec similarity index 100% rename from src/tribler-core/tribler_core/components/libtorrent/download_manager/download_config.spec rename to src/tribler/core/components/libtorrent/download_manager/download_config.spec diff --git a/src/tribler-core/tribler_core/components/libtorrent/download_manager/download_manager.py b/src/tribler/core/components/libtorrent/download_manager/download_manager.py similarity index 97% rename from src/tribler-core/tribler_core/components/libtorrent/download_manager/download_manager.py rename to src/tribler/core/components/libtorrent/download_manager/download_manager.py index 4c7ff7166a4..8510c27a86b 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/download_manager/download_manager.py +++ b/src/tribler/core/components/libtorrent/download_manager/download_manager.py @@ -15,19 +15,19 @@ from ipv8.taskmanager import TaskManager, task -from tribler_core import notifications -from tribler_core.components.libtorrent.download_manager.dht_health_manager import DHTHealthManager -from tribler_core.components.libtorrent.download_manager.download import Download -from tribler_core.components.libtorrent.download_manager.download_config import DownloadConfig -from tribler_core.components.libtorrent.settings import DownloadDefaultsSettings, LibtorrentSettings -from tribler_core.components.libtorrent.torrentdef import TorrentDef, TorrentDefNoMetainfo -from tribler_core.components.libtorrent.utils import torrent_utils -from tribler_core.components.libtorrent.utils.libtorrent_helper import libtorrent as lt -from tribler_core.utilities import path_util -from tribler_core.utilities.network_utils import default_network_utils -from tribler_core.utilities.notifier import Notifier -from tribler_core.utilities.path_util import Path -from tribler_core.utilities.rest_utils import ( +from tribler.core import notifications +from tribler.core.components.libtorrent.download_manager.dht_health_manager import DHTHealthManager +from tribler.core.components.libtorrent.download_manager.download import Download +from tribler.core.components.libtorrent.download_manager.download_config import DownloadConfig +from tribler.core.components.libtorrent.settings import DownloadDefaultsSettings, LibtorrentSettings +from tribler.core.components.libtorrent.torrentdef import TorrentDef, TorrentDefNoMetainfo +from tribler.core.components.libtorrent.utils import torrent_utils +from tribler.core.components.libtorrent.utils.libtorrent_helper import libtorrent as lt +from tribler.core.utilities import path_util +from tribler.core.utilities.network_utils import default_network_utils +from tribler.core.utilities.notifier import Notifier +from tribler.core.utilities.path_util import Path +from tribler.core.utilities.rest_utils import ( FILE_SCHEME, HTTPS_SCHEME, HTTP_SCHEME, @@ -35,10 +35,10 @@ scheme_from_uri, uri_to_path, ) -from tribler_core.utilities.simpledefs import DLSTATUS_SEEDING, MAX_LIBTORRENT_RATE_LIMIT, NTFY, STATEDIR_CHECKPOINT_DIR -from tribler_core.utilities.unicode import hexlify -from tribler_core.utilities.utilities import bdecode_compat, has_bep33_support, parse_magnetlink -from tribler_core.version import version_id +from tribler.core.utilities.simpledefs import DLSTATUS_SEEDING, MAX_LIBTORRENT_RATE_LIMIT, NTFY, STATEDIR_CHECKPOINT_DIR +from tribler.core.utilities.unicode import hexlify +from tribler.core.utilities.utilities import bdecode_compat, has_bep33_support, parse_magnetlink +from tribler.core.version import version_id SOCKS5_PROXY_DEF = 2 diff --git a/src/tribler-core/tribler_core/components/libtorrent/download_manager/download_state.py b/src/tribler/core/components/libtorrent/download_manager/download_state.py similarity index 99% rename from src/tribler-core/tribler_core/components/libtorrent/download_manager/download_state.py rename to src/tribler/core/components/libtorrent/download_manager/download_state.py index 64d0f299922..0682865b910 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/download_manager/download_state.py +++ b/src/tribler/core/components/libtorrent/download_manager/download_state.py @@ -5,7 +5,7 @@ """ import logging -from tribler_core.utilities.simpledefs import ( +from tribler.core.utilities.simpledefs import ( DLSTATUS_ALLOCATING_DISKSPACE, DLSTATUS_DOWNLOADING, DLSTATUS_HASHCHECKING, diff --git a/src/tribler-core/tribler_core/components/libtorrent/download_manager/stream.py b/src/tribler/core/components/libtorrent/download_manager/stream.py similarity index 99% rename from src/tribler-core/tribler_core/components/libtorrent/download_manager/stream.py rename to src/tribler/core/components/libtorrent/download_manager/stream.py index 8184bf680d1..fc834a91999 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/download_manager/stream.py +++ b/src/tribler/core/components/libtorrent/download_manager/stream.py @@ -20,8 +20,8 @@ import logging from asyncio import sleep -from tribler_core.components.libtorrent.utils.torrent_utils import check_vod, get_info_from_handle -from tribler_core.utilities.simpledefs import DLSTATUS_DOWNLOADING, DLSTATUS_SEEDING +from tribler.core.components.libtorrent.utils.torrent_utils import check_vod, get_info_from_handle +from tribler.core.utilities.simpledefs import DLSTATUS_DOWNLOADING, DLSTATUS_SEEDING # Header and footer sizes are necessary for video client to detect file codecs and muxer metadata. # Without below pieces are ready, streamer should not start diff --git a/src/tribler-core/tribler_core/components/libtorrent/libtorrent_component.py b/src/tribler/core/components/libtorrent/libtorrent_component.py similarity index 80% rename from src/tribler-core/tribler_core/components/libtorrent/libtorrent_component.py rename to src/tribler/core/components/libtorrent/libtorrent_component.py index 208959df623..7be55b24c9c 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/libtorrent_component.py +++ b/src/tribler/core/components/libtorrent/libtorrent_component.py @@ -1,8 +1,8 @@ -from tribler_core.components.base import Component -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.libtorrent.download_manager.download_manager import DownloadManager -from tribler_core.components.socks_servers.socks_servers_component import SocksServersComponent -from tribler_core.utilities.rest_utils import path_to_uri +from tribler.core.components.base import Component +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.libtorrent.download_manager.download_manager import DownloadManager +from tribler.core.components.socks_servers.socks_servers_component import SocksServersComponent +from tribler.core.utilities.rest_utils import path_to_uri class LibtorrentComponent(Component): @@ -33,7 +33,7 @@ async def run(self): await self.download_manager.load_checkpoints() if config.gui_test_mode: - from tribler_core.tests.tools.common import TORRENT_WITH_DIRS # pylint: disable=import-outside-toplevel + from tribler.core.tests.tools.common import TORRENT_WITH_DIRS # pylint: disable=import-outside-toplevel uri = path_to_uri(TORRENT_WITH_DIRS) await self.download_manager.start_download_from_uri(uri) diff --git a/src/tribler-core/tribler_core/components/libtorrent/restapi/tests/__init__.py b/src/tribler/core/components/libtorrent/restapi/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/libtorrent/restapi/tests/__init__.py rename to src/tribler/core/components/libtorrent/restapi/__init__.py diff --git a/src/tribler-core/tribler_core/components/libtorrent/restapi/create_torrent_endpoint.py b/src/tribler/core/components/libtorrent/restapi/create_torrent_endpoint.py similarity index 86% rename from src/tribler-core/tribler_core/components/libtorrent/restapi/create_torrent_endpoint.py rename to src/tribler/core/components/libtorrent/restapi/create_torrent_endpoint.py index 442f4fac225..5b343d22e2a 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/restapi/create_torrent_endpoint.py +++ b/src/tribler/core/components/libtorrent/restapi/create_torrent_endpoint.py @@ -9,15 +9,15 @@ from marshmallow.fields import String -from tribler_core.components.libtorrent.download_manager.download_config import DownloadConfig -from tribler_core.components.libtorrent.download_manager.download_manager import DownloadManager -from tribler_core.components.libtorrent.torrentdef import TorrentDef -from tribler_core.components.restapi.rest.rest_endpoint import HTTP_BAD_REQUEST, RESTEndpoint, RESTResponse -from tribler_core.components.restapi.rest.schema import HandledErrorSchema -from tribler_core.components.restapi.rest.util import return_handled_exception -from tribler_core.utilities.path_util import Path -from tribler_core.utilities.unicode import ensure_unicode, recursive_bytes -from tribler_core.utilities.utilities import bdecode_compat, froze_it +from tribler.core.components.libtorrent.download_manager.download_config import DownloadConfig +from tribler.core.components.libtorrent.download_manager.download_manager import DownloadManager +from tribler.core.components.libtorrent.torrentdef import TorrentDef +from tribler.core.components.restapi.rest.rest_endpoint import HTTP_BAD_REQUEST, RESTEndpoint, RESTResponse +from tribler.core.components.restapi.rest.schema import HandledErrorSchema +from tribler.core.components.restapi.rest.util import return_handled_exception +from tribler.core.utilities.path_util import Path +from tribler.core.utilities.unicode import ensure_unicode, recursive_bytes +from tribler.core.utilities.utilities import bdecode_compat, froze_it @froze_it @@ -88,7 +88,7 @@ async def create_torrent(self, request): if 'export_dir' in parameters and parameters['export_dir']: export_dir = Path(parameters['export_dir']) - from tribler_core.version import version_id + from tribler.core.version import version_id params['created by'] = f"Tribler version: {version_id}" params['nodes'] = False diff --git a/src/tribler-core/tribler_core/components/libtorrent/restapi/downloads_endpoint.py b/src/tribler/core/components/libtorrent/restapi/downloads_endpoint.py similarity index 97% rename from src/tribler-core/tribler_core/components/libtorrent/restapi/downloads_endpoint.py rename to src/tribler/core/components/libtorrent/restapi/downloads_endpoint.py index a24fe29b893..e5862a039da 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/restapi/downloads_endpoint.py +++ b/src/tribler/core/components/libtorrent/restapi/downloads_endpoint.py @@ -12,11 +12,11 @@ from marshmallow.fields import Boolean, Float, Integer, List, String -from tribler_core.components.libtorrent.download_manager.download_config import DownloadConfig -from tribler_core.components.libtorrent.download_manager.download_manager import DownloadManager -from tribler_core.components.libtorrent.download_manager.stream import STREAM_PAUSE_TIME, StreamChunk -from tribler_core.components.libtorrent.utils.libtorrent_helper import libtorrent as lt -from tribler_core.components.restapi.rest.rest_endpoint import ( +from tribler.core.components.libtorrent.download_manager.download_config import DownloadConfig +from tribler.core.components.libtorrent.download_manager.download_manager import DownloadManager +from tribler.core.components.libtorrent.download_manager.stream import STREAM_PAUSE_TIME, StreamChunk +from tribler.core.components.libtorrent.utils.libtorrent_helper import libtorrent as lt +from tribler.core.components.restapi.rest.rest_endpoint import ( HTTP_BAD_REQUEST, HTTP_INTERNAL_SERVER_ERROR, HTTP_NOT_FOUND, @@ -24,9 +24,9 @@ RESTResponse, RESTStreamResponse, ) -from tribler_core.components.restapi.rest.util import return_handled_exception -from tribler_core.utilities.path_util import Path -from tribler_core.utilities.simpledefs import ( +from tribler.core.components.restapi.rest.util import return_handled_exception +from tribler.core.utilities.path_util import Path +from tribler.core.utilities.simpledefs import ( DLSTATUS_CIRCUITS, DLSTATUS_EXIT_NODES, DLSTATUS_STOPPED, @@ -34,8 +34,8 @@ UPLOAD, dlstatus_strings, ) -from tribler_core.utilities.unicode import ensure_unicode, hexlify -from tribler_core.utilities.utilities import froze_it +from tribler.core.utilities.unicode import ensure_unicode, hexlify +from tribler.core.utilities.utilities import froze_it def _safe_extended_peer_info(ext_peer_info): diff --git a/src/tribler-core/tribler_core/components/libtorrent/restapi/libtorrent_endpoint.py b/src/tribler/core/components/libtorrent/restapi/libtorrent_endpoint.py similarity index 93% rename from src/tribler-core/tribler_core/components/libtorrent/restapi/libtorrent_endpoint.py rename to src/tribler/core/components/libtorrent/restapi/libtorrent_endpoint.py index efdd5c08d55..180affa4c21 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/restapi/libtorrent_endpoint.py +++ b/src/tribler/core/components/libtorrent/restapi/libtorrent_endpoint.py @@ -8,10 +8,10 @@ from marshmallow.fields import Integer -from tribler_core.components.libtorrent.download_manager.download_manager import DownloadManager -from tribler_core.components.restapi.rest.rest_endpoint import RESTEndpoint, RESTResponse -from tribler_core.utilities.unicode import hexlify -from tribler_core.utilities.utilities import froze_it +from tribler.core.components.libtorrent.download_manager.download_manager import DownloadManager +from tribler.core.components.restapi.rest.rest_endpoint import RESTEndpoint, RESTResponse +from tribler.core.utilities.unicode import hexlify +from tribler.core.utilities.utilities import froze_it @froze_it diff --git a/src/tribler-core/tribler_core/components/libtorrent/tests/__init__.py b/src/tribler/core/components/libtorrent/restapi/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/libtorrent/tests/__init__.py rename to src/tribler/core/components/libtorrent/restapi/tests/__init__.py diff --git a/src/tribler-core/tribler_core/components/libtorrent/restapi/tests/test_downloads_endpoint.py b/src/tribler/core/components/libtorrent/restapi/tests/test_downloads_endpoint.py similarity index 97% rename from src/tribler-core/tribler_core/components/libtorrent/restapi/tests/test_downloads_endpoint.py rename to src/tribler/core/components/libtorrent/restapi/tests/test_downloads_endpoint.py index e728c6de6e1..974d0571a53 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/restapi/tests/test_downloads_endpoint.py +++ b/src/tribler/core/components/libtorrent/restapi/tests/test_downloads_endpoint.py @@ -8,19 +8,19 @@ import pytest -from tribler_core.components.libtorrent.download_manager.download_state import DownloadState -from tribler_core.components.libtorrent.restapi.downloads_endpoint import DownloadsEndpoint, get_extended_status -from tribler_core.components.restapi.rest.base_api_test import do_request -from tribler_core.components.restapi.rest.rest_manager import error_middleware -from tribler_core.tests.tools.common import TESTS_DATA_DIR -from tribler_core.utilities.rest_utils import HTTP_SCHEME, path_to_uri -from tribler_core.utilities.simpledefs import ( +from tribler.core.components.libtorrent.download_manager.download_state import DownloadState +from tribler.core.components.libtorrent.restapi.downloads_endpoint import DownloadsEndpoint, get_extended_status +from tribler.core.components.restapi.rest.base_api_test import do_request +from tribler.core.components.restapi.rest.rest_manager import error_middleware +from tribler.core.tests.tools.common import TESTS_DATA_DIR +from tribler.core.utilities.rest_utils import HTTP_SCHEME, path_to_uri +from tribler.core.utilities.simpledefs import ( DLSTATUS_CIRCUITS, DLSTATUS_DOWNLOADING, DLSTATUS_EXIT_NODES, DLSTATUS_STOPPED, ) -from tribler_core.utilities.unicode import hexlify +from tribler.core.utilities.unicode import hexlify @pytest.fixture diff --git a/src/tribler-core/tribler_core/components/libtorrent/restapi/tests/test_libtorrent_endpoint.py b/src/tribler/core/components/libtorrent/restapi/tests/test_libtorrent_endpoint.py similarity index 93% rename from src/tribler-core/tribler_core/components/libtorrent/restapi/tests/test_libtorrent_endpoint.py rename to src/tribler/core/components/libtorrent/restapi/tests/test_libtorrent_endpoint.py index e02f3957c0e..aed78cde9ed 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/restapi/tests/test_libtorrent_endpoint.py +++ b/src/tribler/core/components/libtorrent/restapi/tests/test_libtorrent_endpoint.py @@ -4,10 +4,10 @@ import pytest -from tribler_core.components.libtorrent.restapi.libtorrent_endpoint import LibTorrentEndpoint -from tribler_core.components.restapi.rest.base_api_test import do_request -from tribler_core.components.restapi.rest.rest_manager import error_middleware -from tribler_core.utilities.unicode import hexlify +from tribler.core.components.libtorrent.restapi.libtorrent_endpoint import LibTorrentEndpoint +from tribler.core.components.restapi.rest.base_api_test import do_request +from tribler.core.components.restapi.rest.rest_manager import error_middleware +from tribler.core.utilities.unicode import hexlify @pytest.fixture diff --git a/src/tribler-core/tribler_core/components/libtorrent/restapi/tests/test_torrentinfo_endpoint.py b/src/tribler/core/components/libtorrent/restapi/tests/test_torrentinfo_endpoint.py similarity index 90% rename from src/tribler-core/tribler_core/components/libtorrent/restapi/tests/test_torrentinfo_endpoint.py rename to src/tribler/core/components/libtorrent/restapi/tests/test_torrentinfo_endpoint.py index fc914f0ebf6..f6c6d4bda87 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/restapi/tests/test_torrentinfo_endpoint.py +++ b/src/tribler/core/components/libtorrent/restapi/tests/test_torrentinfo_endpoint.py @@ -10,16 +10,16 @@ import pytest -from tribler_core import notifications -from tribler_core.components.libtorrent.restapi.torrentinfo_endpoint import TorrentInfoEndpoint -from tribler_core.components.libtorrent.settings import LibtorrentSettings -from tribler_core.components.libtorrent.torrentdef import TorrentDef -from tribler_core.components.metadata_store.db.orm_bindings.torrent_metadata import tdef_to_metadata_dict -from tribler_core.components.restapi.rest.base_api_test import do_request -from tribler_core.components.restapi.rest.rest_manager import error_middleware -from tribler_core.tests.tools.common import TESTS_DATA_DIR, TESTS_DIR, TORRENT_UBUNTU_FILE, UBUNTU_1504_INFOHASH -from tribler_core.utilities.rest_utils import path_to_uri -from tribler_core.utilities.unicode import hexlify +from tribler.core import notifications +from tribler.core.components.libtorrent.restapi.torrentinfo_endpoint import TorrentInfoEndpoint +from tribler.core.components.libtorrent.settings import LibtorrentSettings +from tribler.core.components.libtorrent.torrentdef import TorrentDef +from tribler.core.components.metadata_store.db.orm_bindings.torrent_metadata import tdef_to_metadata_dict +from tribler.core.components.restapi.rest.base_api_test import do_request +from tribler.core.components.restapi.rest.rest_manager import error_middleware +from tribler.core.tests.tools.common import TESTS_DATA_DIR, TESTS_DIR, TORRENT_UBUNTU_FILE, UBUNTU_1504_INFOHASH +from tribler.core.utilities.rest_utils import path_to_uri +from tribler.core.utilities.unicode import hexlify SAMPLE_CHANNEL_FILES_DIR = TESTS_DIR / "data" / "sample_channel" @@ -98,7 +98,7 @@ async def mock_http_query(*_): with open(tmp_path / "ubuntu.torrent", 'rb') as f: return f.read() - with patch("tribler_core.components.libtorrent.restapi.torrentinfo_endpoint.query_http_uri", new=mock_http_query): + with patch("tribler.core.components.libtorrent.restapi.torrentinfo_endpoint.query_http_uri", new=mock_http_query): verify_valid_dict(await do_request(rest_api, url, params={'uri': path}, expected_code=200)) path = quote_plus(f'magnet:?xt=urn:btih:{hexlify(UBUNTU_1504_INFOHASH)}' diff --git a/src/tribler-core/tribler_core/components/libtorrent/restapi/torrentinfo_endpoint.py b/src/tribler/core/components/libtorrent/restapi/torrentinfo_endpoint.py similarity index 91% rename from src/tribler-core/tribler_core/components/libtorrent/restapi/torrentinfo_endpoint.py rename to src/tribler/core/components/libtorrent/restapi/torrentinfo_endpoint.py index 0db741e97f4..be775672fe7 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/restapi/torrentinfo_endpoint.py +++ b/src/tribler/core/components/libtorrent/restapi/torrentinfo_endpoint.py @@ -10,18 +10,18 @@ from marshmallow.fields import String -from tribler_core import notifications -from tribler_core.components.libtorrent.download_manager.download_manager import DownloadManager -from tribler_core.components.libtorrent.torrentdef import TorrentDef -from tribler_core.components.libtorrent.utils.libtorrent_helper import libtorrent as lt -from tribler_core.components.metadata_store.db.orm_bindings.torrent_metadata import tdef_to_metadata_dict -from tribler_core.components.restapi.rest.rest_endpoint import ( +from tribler.core import notifications +from tribler.core.components.libtorrent.download_manager.download_manager import DownloadManager +from tribler.core.components.libtorrent.torrentdef import TorrentDef +from tribler.core.components.libtorrent.utils.libtorrent_helper import libtorrent as lt +from tribler.core.components.metadata_store.db.orm_bindings.torrent_metadata import tdef_to_metadata_dict +from tribler.core.components.restapi.rest.rest_endpoint import ( HTTP_BAD_REQUEST, HTTP_INTERNAL_SERVER_ERROR, RESTEndpoint, RESTResponse, ) -from tribler_core.utilities.rest_utils import ( +from tribler.core.utilities.rest_utils import ( FILE_SCHEME, HTTPS_SCHEME, HTTP_SCHEME, @@ -29,8 +29,8 @@ scheme_from_uri, uri_to_path, ) -from tribler_core.utilities.unicode import hexlify, recursive_unicode -from tribler_core.utilities.utilities import bdecode_compat, froze_it, parse_magnetlink +from tribler.core.utilities.unicode import hexlify, recursive_unicode +from tribler.core.utilities.utilities import bdecode_compat, froze_it, parse_magnetlink async def query_http_uri(uri: str) -> bytes: diff --git a/src/tribler-core/tribler_core/components/libtorrent/settings.py b/src/tribler/core/components/libtorrent/settings.py similarity index 89% rename from src/tribler-core/tribler_core/components/libtorrent/settings.py rename to src/tribler/core/components/libtorrent/settings.py index 86d01154664..b2a95b81e2a 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/settings.py +++ b/src/tribler/core/components/libtorrent/settings.py @@ -3,9 +3,9 @@ from pydantic import validator -from tribler_core.components.libtorrent.download_manager.download_config import get_default_dest_dir -from tribler_core.config.tribler_config_section import TriblerConfigSection -from tribler_core.utilities.network_utils import NetworkUtils +from tribler.core.components.libtorrent.download_manager.download_config import get_default_dest_dir +from tribler.core.config.tribler_config_section import TriblerConfigSection +from tribler.core.utilities.network_utils import NetworkUtils # pylint: disable=no-self-argument diff --git a/src/tribler-core/tribler_core/components/libtorrent/utils/__init__.py b/src/tribler/core/components/libtorrent/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/libtorrent/utils/__init__.py rename to src/tribler/core/components/libtorrent/tests/__init__.py diff --git a/src/tribler-core/tribler_core/components/libtorrent/tests/conftest.py b/src/tribler/core/components/libtorrent/tests/conftest.py similarity index 87% rename from src/tribler-core/tribler_core/components/libtorrent/tests/conftest.py rename to src/tribler/core/components/libtorrent/tests/conftest.py index fccb5f5b181..e46b297f58f 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/tests/conftest.py +++ b/src/tribler/core/components/libtorrent/tests/conftest.py @@ -1,6 +1,6 @@ import pytest -from tribler_core.components.libtorrent.torrentdef import TorrentDef, TorrentDefNoMetainfo +from tribler.core.components.libtorrent.torrentdef import TorrentDef, TorrentDefNoMetainfo @pytest.fixture diff --git a/src/tribler-core/tribler_core/components/libtorrent/tests/test_dht_health_manager.py b/src/tribler/core/components/libtorrent/tests/test_dht_health_manager.py similarity index 96% rename from src/tribler-core/tribler_core/components/libtorrent/tests/test_dht_health_manager.py rename to src/tribler/core/components/libtorrent/tests/test_dht_health_manager.py index 8eb4959ef3e..de23ed5ef81 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/tests/test_dht_health_manager.py +++ b/src/tribler/core/components/libtorrent/tests/test_dht_health_manager.py @@ -5,8 +5,8 @@ import pytest -from tribler_core.components.libtorrent.download_manager.dht_health_manager import DHTHealthManager -from tribler_core.utilities.unicode import hexlify +from tribler.core.components.libtorrent.download_manager.dht_health_manager import DHTHealthManager +from tribler.core.utilities.unicode import hexlify @pytest.fixture diff --git a/src/tribler-core/tribler_core/components/libtorrent/tests/test_download.py b/src/tribler/core/components/libtorrent/tests/test_download.py similarity index 97% rename from src/tribler-core/tribler_core/components/libtorrent/tests/test_download.py rename to src/tribler/core/components/libtorrent/tests/test_download.py index a2cea81392c..69799c91d2f 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/tests/test_download.py +++ b/src/tribler/core/components/libtorrent/tests/test_download.py @@ -9,13 +9,13 @@ import pytest -from tribler_core.exceptions import SaveResumeDataError -from tribler_core.components.libtorrent.download_manager.download_config import DownloadConfig -from tribler_core.tests.tools.base_test import MockObject -from tribler_core.tests.tools.common import TESTS_DATA_DIR -from tribler_core.components.libtorrent.utils.torrent_utils import get_info_from_handle -from tribler_core.utilities.unicode import hexlify -from tribler_core.utilities.utilities import bdecode_compat +from tribler.core.exceptions import SaveResumeDataError +from tribler.core.components.libtorrent.download_manager.download_config import DownloadConfig +from tribler.core.tests.tools.base_test import MockObject +from tribler.core.tests.tools.common import TESTS_DATA_DIR +from tribler.core.components.libtorrent.utils.torrent_utils import get_info_from_handle +from tribler.core.utilities.unicode import hexlify +from tribler.core.utilities.utilities import bdecode_compat def test_download_properties(test_download, test_tdef): diff --git a/src/tribler-core/tribler_core/components/libtorrent/tests/test_download_api.py b/src/tribler/core/components/libtorrent/tests/test_download_api.py similarity index 85% rename from src/tribler-core/tribler_core/components/libtorrent/tests/test_download_api.py rename to src/tribler/core/components/libtorrent/tests/test_download_api.py index 08fd2382446..3d892cce1cb 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/tests/test_download_api.py +++ b/src/tribler/core/components/libtorrent/tests/test_download_api.py @@ -2,9 +2,9 @@ import pytest -from tribler_core.tests.tools.common import TORRENT_UBUNTU_FILE -from tribler_core.utilities.rest_utils import path_to_uri -from tribler_core.utilities.simpledefs import DLSTATUS_DOWNLOADING +from tribler.core.tests.tools.common import TORRENT_UBUNTU_FILE +from tribler.core.utilities.rest_utils import path_to_uri +from tribler.core.utilities.simpledefs import DLSTATUS_DOWNLOADING @pytest.mark.asyncio diff --git a/src/tribler-core/tribler_core/components/libtorrent/tests/test_download_config.py b/src/tribler/core/components/libtorrent/tests/test_download_config.py similarity index 94% rename from src/tribler-core/tribler_core/components/libtorrent/tests/test_download_config.py rename to src/tribler/core/components/libtorrent/tests/test_download_config.py index 202341232dc..938bd571b05 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/tests/test_download_config.py +++ b/src/tribler/core/components/libtorrent/tests/test_download_config.py @@ -4,8 +4,8 @@ import pytest -from tribler_core.components.libtorrent.download_manager.download_config import DownloadConfig, get_default_dest_dir -from tribler_core.tests.tools.common import TESTS_DATA_DIR +from tribler.core.components.libtorrent.download_manager.download_config import DownloadConfig, get_default_dest_dir +from tribler.core.tests.tools.common import TESTS_DATA_DIR CONFIG_FILES_DIR = TESTS_DATA_DIR / "config_files" diff --git a/src/tribler-core/tribler_core/components/libtorrent/tests/test_download_manager.py b/src/tribler/core/components/libtorrent/tests/test_download_manager.py similarity index 97% rename from src/tribler-core/tribler_core/components/libtorrent/tests/test_download_manager.py rename to src/tribler/core/components/libtorrent/tests/test_download_manager.py index bd97f864109..20d8f7cd65c 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/tests/test_download_manager.py +++ b/src/tribler/core/components/libtorrent/tests/test_download_manager.py @@ -7,13 +7,13 @@ import pytest -from tribler_core.components.libtorrent.download_manager.download_manager import DownloadManager -from tribler_core.components.libtorrent.settings import LibtorrentSettings -from tribler_core.components.libtorrent.torrentdef import TorrentDef, TorrentDefNoMetainfo -from tribler_core.tests.tools.common import TESTS_DATA_DIR, TORRENT_UBUNTU_FILE -from tribler_core.utilities.path_util import Path -from tribler_core.utilities.simpledefs import DLSTATUS_SEEDING -from tribler_core.utilities.unicode import hexlify +from tribler.core.components.libtorrent.download_manager.download_manager import DownloadManager +from tribler.core.components.libtorrent.settings import LibtorrentSettings +from tribler.core.components.libtorrent.torrentdef import TorrentDef, TorrentDefNoMetainfo +from tribler.core.tests.tools.common import TESTS_DATA_DIR, TORRENT_UBUNTU_FILE +from tribler.core.utilities.path_util import Path +from tribler.core.utilities.simpledefs import DLSTATUS_SEEDING +from tribler.core.utilities.unicode import hexlify def create_fake_download_and_state(): diff --git a/src/tribler-core/tribler_core/components/libtorrent/tests/test_download_state.py b/src/tribler/core/components/libtorrent/tests/test_download_state.py similarity index 97% rename from src/tribler-core/tribler_core/components/libtorrent/tests/test_download_state.py rename to src/tribler/core/components/libtorrent/tests/test_download_state.py index 82c1fdd4d6b..64950e9ec45 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/tests/test_download_state.py +++ b/src/tribler/core/components/libtorrent/tests/test_download_state.py @@ -2,8 +2,8 @@ import pytest -from tribler_core.components.libtorrent.download_manager.download_state import DownloadState -from tribler_core.utilities.simpledefs import DLSTATUS_DOWNLOADING, DOWNLOAD, UPLOAD +from tribler.core.components.libtorrent.download_manager.download_state import DownloadState +from tribler.core.utilities.simpledefs import DLSTATUS_DOWNLOADING, DOWNLOAD, UPLOAD @pytest.fixture diff --git a/src/tribler-core/tribler_core/components/libtorrent/tests/test_libtorrent_component.py b/src/tribler/core/components/libtorrent/tests/test_libtorrent_component.py similarity index 67% rename from src/tribler-core/tribler_core/components/libtorrent/tests/test_libtorrent_component.py rename to src/tribler/core/components/libtorrent/tests/test_libtorrent_component.py index f3d007d0dda..61ccd0a1130 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/tests/test_libtorrent_component.py +++ b/src/tribler/core/components/libtorrent/tests/test_libtorrent_component.py @@ -1,9 +1,9 @@ import pytest -from tribler_core.components.base import Session -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.libtorrent.libtorrent_component import LibtorrentComponent -from tribler_core.components.socks_servers.socks_servers_component import SocksServersComponent +from tribler.core.components.base import Session +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.libtorrent.libtorrent_component import LibtorrentComponent +from tribler.core.components.socks_servers.socks_servers_component import SocksServersComponent # pylint: disable=protected-access diff --git a/src/tribler-core/tribler_core/components/libtorrent/tests/test_libtorrent_settings.py b/src/tribler/core/components/libtorrent/tests/test_libtorrent_settings.py similarity index 89% rename from src/tribler-core/tribler_core/components/libtorrent/tests/test_libtorrent_settings.py rename to src/tribler/core/components/libtorrent/tests/test_libtorrent_settings.py index 97d9c8fd249..4f633375ae1 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/tests/test_libtorrent_settings.py +++ b/src/tribler/core/components/libtorrent/tests/test_libtorrent_settings.py @@ -1,7 +1,7 @@ import pytest -from tribler_core.components.libtorrent.settings import DownloadDefaultsSettings, LibtorrentSettings, SeedingMode -from tribler_core.utilities.network_utils import NetworkUtils +from tribler.core.components.libtorrent.settings import DownloadDefaultsSettings, LibtorrentSettings, SeedingMode +from tribler.core.utilities.network_utils import NetworkUtils @pytest.mark.asyncio diff --git a/src/tribler-core/tribler_core/components/libtorrent/tests/test_seeding.py b/src/tribler/core/components/libtorrent/tests/test_seeding.py similarity index 80% rename from src/tribler-core/tribler_core/components/libtorrent/tests/test_seeding.py rename to src/tribler/core/components/libtorrent/tests/test_seeding.py index f9b0d673214..ab965857f1f 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/tests/test_seeding.py +++ b/src/tribler/core/components/libtorrent/tests/test_seeding.py @@ -5,9 +5,9 @@ """ import pytest -from tribler_core.components.libtorrent.download_manager.download_config import DownloadConfig -from tribler_core.tests.tools.common import TESTS_DATA_DIR -from tribler_core.utilities.simpledefs import DLSTATUS_SEEDING +from tribler.core.components.libtorrent.download_manager.download_config import DownloadConfig +from tribler.core.tests.tools.common import TESTS_DATA_DIR +from tribler.core.utilities.simpledefs import DLSTATUS_SEEDING @pytest.mark.asyncio diff --git a/src/tribler-core/tribler_core/components/libtorrent/tests/test_torrent_def.py b/src/tribler/core/components/libtorrent/tests/test_torrent_def.py similarity index 97% rename from src/tribler-core/tribler_core/components/libtorrent/tests/test_torrent_def.py rename to src/tribler/core/components/libtorrent/tests/test_torrent_def.py index 016c4befd5b..9ea0a2fe8f1 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/tests/test_torrent_def.py +++ b/src/tribler/core/components/libtorrent/tests/test_torrent_def.py @@ -6,10 +6,10 @@ import pytest -from tribler_core.components.libtorrent.torrentdef import TorrentDef, TorrentDefNoMetainfo -from tribler_core.tests.tools.common import TESTS_DATA_DIR, TORRENT_UBUNTU_FILE -from tribler_core.utilities.path_util import Path -from tribler_core.utilities.utilities import bdecode_compat +from tribler.core.components.libtorrent.torrentdef import TorrentDef, TorrentDefNoMetainfo +from tribler.core.tests.tools.common import TESTS_DATA_DIR, TORRENT_UBUNTU_FILE +from tribler.core.utilities.path_util import Path +from tribler.core.utilities.utilities import bdecode_compat TRACKER = 'http://www.tribler.org/announce' VIDEO_FILE_NAME = "video.avi" diff --git a/src/tribler-core/tribler_core/components/libtorrent/torrentdef.py b/src/tribler/core/components/libtorrent/torrentdef.py similarity index 97% rename from src/tribler-core/tribler_core/components/libtorrent/torrentdef.py rename to src/tribler/core/components/libtorrent/torrentdef.py index 5535447bbd9..492a554072f 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/torrentdef.py +++ b/src/tribler/core/components/libtorrent/torrentdef.py @@ -6,13 +6,13 @@ import aiohttp -from tribler_core.components.libtorrent.utils.libtorrent_helper import libtorrent as lt -from tribler_core.components.libtorrent.utils.torrent_utils import create_torrent_file -from tribler_core.utilities import maketorrent, path_util -from tribler_core.utilities.path_util import Path -from tribler_core.utilities.simpledefs import INFOHASH_LENGTH -from tribler_core.utilities.unicode import ensure_unicode -from tribler_core.utilities.utilities import bdecode_compat, is_valid_url, parse_magnetlink +from tribler.core.components.libtorrent.utils.libtorrent_helper import libtorrent as lt +from tribler.core.components.libtorrent.utils.torrent_utils import create_torrent_file +from tribler.core.utilities import maketorrent, path_util +from tribler.core.utilities.path_util import Path +from tribler.core.utilities.simpledefs import INFOHASH_LENGTH +from tribler.core.utilities.unicode import ensure_unicode +from tribler.core.utilities.utilities import bdecode_compat, is_valid_url, parse_magnetlink def escape_as_utf8(string, encoding='utf8'): diff --git a/src/tribler-core/tribler_core/components/metadata_store/__init__.py b/src/tribler/core/components/libtorrent/utils/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/metadata_store/__init__.py rename to src/tribler/core/components/libtorrent/utils/__init__.py diff --git a/src/tribler-core/tribler_core/components/libtorrent/utils/libtorrent_helper.py b/src/tribler/core/components/libtorrent/utils/libtorrent_helper.py similarity index 100% rename from src/tribler-core/tribler_core/components/libtorrent/utils/libtorrent_helper.py rename to src/tribler/core/components/libtorrent/utils/libtorrent_helper.py diff --git a/src/tribler-core/tribler_core/components/libtorrent/utils/torrent_utils.py b/src/tribler/core/components/libtorrent/utils/torrent_utils.py similarity index 97% rename from src/tribler-core/tribler_core/components/libtorrent/utils/torrent_utils.py rename to src/tribler/core/components/libtorrent/utils/torrent_utils.py index 6f7efca8e02..bdc8f22742c 100644 --- a/src/tribler-core/tribler_core/components/libtorrent/utils/torrent_utils.py +++ b/src/tribler/core/components/libtorrent/utils/torrent_utils.py @@ -3,8 +3,8 @@ from contextlib import suppress from hashlib import sha1 -from tribler_core.components.libtorrent.utils.libtorrent_helper import libtorrent as lt -from tribler_core.utilities.path_util import Path +from tribler.core.components.libtorrent.utils.libtorrent_helper import libtorrent as lt +from tribler.core.utilities.path_util import Path logger = logging.getLogger(__name__) diff --git a/src/tribler-core/tribler_core/components/metadata_store/category_filter/tests/__init__.py b/src/tribler/core/components/metadata_store/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/metadata_store/category_filter/tests/__init__.py rename to src/tribler/core/components/metadata_store/__init__.py diff --git a/src/tribler-core/tribler_core/components/metadata_store/category_filter/__init__.py b/src/tribler/core/components/metadata_store/category_filter/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/metadata_store/category_filter/__init__.py rename to src/tribler/core/components/metadata_store/category_filter/__init__.py diff --git a/src/tribler-core/tribler_core/components/metadata_store/category_filter/category.conf b/src/tribler/core/components/metadata_store/category_filter/category.conf similarity index 100% rename from src/tribler-core/tribler_core/components/metadata_store/category_filter/category.conf rename to src/tribler/core/components/metadata_store/category_filter/category.conf diff --git a/src/tribler-core/tribler_core/components/metadata_store/category_filter/category.py b/src/tribler/core/components/metadata_store/category_filter/category.py similarity index 95% rename from src/tribler-core/tribler_core/components/metadata_store/category_filter/category.py rename to src/tribler/core/components/metadata_store/category_filter/category.py index 34d2b12fcd3..f1109340d30 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/category_filter/category.py +++ b/src/tribler/core/components/metadata_store/category_filter/category.py @@ -7,10 +7,10 @@ import re from functools import cmp_to_key -from tribler_core.components.metadata_store.category_filter.family_filter import default_xxx_filter -from tribler_core.components.metadata_store.category_filter.init_category import getCategoryInfo -from tribler_core.utilities.install_dir import get_lib_path -from tribler_core.utilities.unicode import recursive_unicode +from tribler.core.components.metadata_store.category_filter.family_filter import default_xxx_filter +from tribler.core.components.metadata_store.category_filter.init_category import getCategoryInfo +from tribler.core.utilities.install_dir import get_lib_path +from tribler.core.utilities.unicode import recursive_unicode CATEGORY_CONFIG_FILE = get_lib_path() / 'components/metadata_store/category_filter/category.conf' diff --git a/src/tribler-core/tribler_core/components/metadata_store/category_filter/family_filter.py b/src/tribler/core/components/metadata_store/category_filter/family_filter.py similarity index 98% rename from src/tribler-core/tribler_core/components/metadata_store/category_filter/family_filter.py rename to src/tribler/core/components/metadata_store/category_filter/family_filter.py index a3386352034..c0df67a2ad9 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/category_filter/family_filter.py +++ b/src/tribler/core/components/metadata_store/category_filter/family_filter.py @@ -6,7 +6,7 @@ import logging import re -from tribler_core.utilities.install_dir import get_lib_path +from tribler.core.utilities.install_dir import get_lib_path WORDS_REGEXP = re.compile('[a-zA-Z0-9]+') diff --git a/src/tribler-core/tribler_core/components/metadata_store/category_filter/filter_terms.filter b/src/tribler/core/components/metadata_store/category_filter/filter_terms.filter similarity index 100% rename from src/tribler-core/tribler_core/components/metadata_store/category_filter/filter_terms.filter rename to src/tribler/core/components/metadata_store/category_filter/filter_terms.filter diff --git a/src/tribler-core/tribler_core/components/metadata_store/category_filter/init_category.py b/src/tribler/core/components/metadata_store/category_filter/init_category.py similarity index 100% rename from src/tribler-core/tribler_core/components/metadata_store/category_filter/init_category.py rename to src/tribler/core/components/metadata_store/category_filter/init_category.py diff --git a/src/tribler-core/tribler_core/components/metadata_store/category_filter/l2_filter.py b/src/tribler/core/components/metadata_store/category_filter/l2_filter.py similarity index 89% rename from src/tribler-core/tribler_core/components/metadata_store/category_filter/l2_filter.py rename to src/tribler/core/components/metadata_store/category_filter/l2_filter.py index e398dcca52c..21257fdd789 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/category_filter/l2_filter.py +++ b/src/tribler/core/components/metadata_store/category_filter/l2_filter.py @@ -1,6 +1,6 @@ import re -from tribler_core.utilities.install_dir import get_lib_path +from tribler.core.utilities.install_dir import get_lib_path # !ACHTUNG! We must first read the line into a file, then release the lock, and only then pass it to regex compiler. # Otherwise, there is an annoying race condition that reads in an empty file! diff --git a/src/tribler-core/tribler_core/components/metadata_store/category_filter/level2.regex b/src/tribler/core/components/metadata_store/category_filter/level2.regex similarity index 100% rename from src/tribler-core/tribler_core/components/metadata_store/category_filter/level2.regex rename to src/tribler/core/components/metadata_store/category_filter/level2.regex diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/__init__.py b/src/tribler/core/components/metadata_store/category_filter/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/metadata_store/db/__init__.py rename to src/tribler/core/components/metadata_store/category_filter/tests/__init__.py diff --git a/src/tribler-core/tribler_core/components/metadata_store/category_filter/tests/test_category.py b/src/tribler/core/components/metadata_store/category_filter/tests/test_category.py similarity index 93% rename from src/tribler-core/tribler_core/components/metadata_store/category_filter/tests/test_category.py rename to src/tribler/core/components/metadata_store/category_filter/tests/test_category.py index 14d0a48a166..4751d049257 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/category_filter/tests/test_category.py +++ b/src/tribler/core/components/metadata_store/category_filter/tests/test_category.py @@ -1,7 +1,7 @@ import pytest -from tribler_core.components.metadata_store.category_filter.category import Category, cmp_rank -from tribler_core.components.metadata_store.category_filter.family_filter import XXXFilter +from tribler.core.components.metadata_store.category_filter.category import Category, cmp_rank +from tribler.core.components.metadata_store.category_filter.family_filter import XXXFilter @pytest.fixture(name="xxx_filter") diff --git a/src/tribler-core/tribler_core/components/metadata_store/category_filter/tests/test_family_filter.py b/src/tribler/core/components/metadata_store/category_filter/tests/test_family_filter.py similarity index 89% rename from src/tribler-core/tribler_core/components/metadata_store/category_filter/tests/test_family_filter.py rename to src/tribler/core/components/metadata_store/category_filter/tests/test_family_filter.py index f73a2df66d3..1125ad96d1c 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/category_filter/tests/test_family_filter.py +++ b/src/tribler/core/components/metadata_store/category_filter/tests/test_family_filter.py @@ -1,7 +1,7 @@ import pytest -from tribler_core.components.metadata_store.category_filter.family_filter import XXXFilter -from tribler_core.components.metadata_store.category_filter.l2_filter import is_forbidden +from tribler.core.components.metadata_store.category_filter.family_filter import XXXFilter +from tribler.core.components.metadata_store.category_filter.l2_filter import is_forbidden @pytest.fixture diff --git a/src/tribler-core/tribler_core/components/metadata_store/category_filter/tests/test_init_category.py b/src/tribler/core/components/metadata_store/category_filter/tests/test_init_category.py similarity index 78% rename from src/tribler-core/tribler_core/components/metadata_store/category_filter/tests/test_init_category.py rename to src/tribler/core/components/metadata_store/category_filter/tests/test_init_category.py index 30287090c63..20da1bf0c4f 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/category_filter/tests/test_init_category.py +++ b/src/tribler/core/components/metadata_store/category_filter/tests/test_init_category.py @@ -1,5 +1,5 @@ -from tribler_core.components.metadata_store.category_filter.category import CATEGORY_CONFIG_FILE -from tribler_core.components.metadata_store.category_filter.init_category import INIT_FUNC_DICT, getCategoryInfo +from tribler.core.components.metadata_store.category_filter.category import CATEGORY_CONFIG_FILE +from tribler.core.components.metadata_store.category_filter.init_category import INIT_FUNC_DICT, getCategoryInfo def test_split_list(): diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/tests/__init__.py b/src/tribler/core/components/metadata_store/db/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/metadata_store/db/tests/__init__.py rename to src/tribler/core/components/metadata_store/db/__init__.py diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/__init__.py b/src/tribler/core/components/metadata_store/db/orm_bindings/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/__init__.py rename to src/tribler/core/components/metadata_store/db/orm_bindings/__init__.py diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/binary_node.py b/src/tribler/core/components/metadata_store/db/orm_bindings/binary_node.py similarity index 92% rename from src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/binary_node.py rename to src/tribler/core/components/metadata_store/db/orm_bindings/binary_node.py index ba56337fa1d..28f2de5d233 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/binary_node.py +++ b/src/tribler/core/components/metadata_store/db/orm_bindings/binary_node.py @@ -1,6 +1,6 @@ from pony.orm import Optional -from tribler_core.components.metadata_store.db.serialization import BINARY_NODE, BinaryNodePayload +from tribler.core.components.metadata_store.db.serialization import BINARY_NODE, BinaryNodePayload def define_binding(db, db_version: int): diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/channel_description.py b/src/tribler/core/components/metadata_store/db/orm_bindings/channel_description.py similarity index 79% rename from src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/channel_description.py rename to src/tribler/core/components/metadata_store/db/orm_bindings/channel_description.py index 4a4b3012e58..f75f3c4540c 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/channel_description.py +++ b/src/tribler/core/components/metadata_store/db/orm_bindings/channel_description.py @@ -1,4 +1,4 @@ -from tribler_core.components.metadata_store.db.serialization import CHANNEL_DESCRIPTION +from tribler.core.components.metadata_store.db.serialization import CHANNEL_DESCRIPTION def define_binding(db): diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/channel_metadata.py b/src/tribler/core/components/metadata_store/db/orm_bindings/channel_metadata.py similarity index 98% rename from src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/channel_metadata.py rename to src/tribler/core/components/metadata_store/db/orm_bindings/channel_metadata.py index 34f84752e43..c85891aec3c 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/channel_metadata.py +++ b/src/tribler/core/components/metadata_store/db/orm_bindings/channel_metadata.py @@ -7,8 +7,8 @@ from pony import orm from pony.orm import db_session, raw_sql, select -from tribler_core.components.libtorrent.utils.libtorrent_helper import libtorrent as lt -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import ( +from tribler.core.components.libtorrent.utils.libtorrent_helper import libtorrent as lt +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import ( CHANNEL_DESCRIPTION_FLAG, CHANNEL_THUMBNAIL_FLAG, COMMITTED, @@ -18,16 +18,16 @@ TODELETE, UPDATED, ) -from tribler_core.components.metadata_store.db.orm_bindings.discrete_clock import clock -from tribler_core.components.metadata_store.db.serialization import ( +from tribler.core.components.metadata_store.db.orm_bindings.discrete_clock import clock +from tribler.core.components.metadata_store.db.serialization import ( CHANNEL_TORRENT, ChannelMetadataPayload, HealthItemsPayload, ) -from tribler_core.utilities.path_util import Path -from tribler_core.utilities.simpledefs import CHANNEL_STATE -from tribler_core.utilities.unicode import hexlify -from tribler_core.utilities.utilities import random_infohash +from tribler.core.utilities.path_util import Path +from tribler.core.utilities.simpledefs import CHANNEL_STATE +from tribler.core.utilities.unicode import hexlify +from tribler.core.utilities.utilities import random_infohash CHANNEL_DIR_NAME_PK_LENGTH = 32 # Its not 40 so it could be distinguished from infohash CHANNEL_DIR_NAME_ID_LENGTH = 16 # Zero-padded long int in hex form diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/channel_node.py b/src/tribler/core/components/metadata_store/db/orm_bindings/channel_node.py similarity index 97% rename from src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/channel_node.py rename to src/tribler/core/components/metadata_store/db/orm_bindings/channel_node.py index e4913e56e42..81c9650d1a4 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/channel_node.py +++ b/src/tribler/core/components/metadata_store/db/orm_bindings/channel_node.py @@ -6,16 +6,16 @@ from pony import orm from pony.orm.core import DEFAULT, db_session -from tribler_core.components.metadata_store.db.orm_bindings.discrete_clock import clock -from tribler_core.components.metadata_store.db.serialization import ( +from tribler.core.components.metadata_store.db.orm_bindings.discrete_clock import clock +from tribler.core.components.metadata_store.db.serialization import ( CHANNEL_NODE, ChannelNodePayload, DELETED, DeletedMetadataPayload, ) -from tribler_core.exceptions import InvalidChannelNodeException, InvalidSignatureException -from tribler_core.utilities.path_util import Path -from tribler_core.utilities.unicode import hexlify +from tribler.core.exceptions import InvalidChannelNodeException, InvalidSignatureException +from tribler.core.utilities.path_util import Path +from tribler.core.utilities.unicode import hexlify # Metadata, torrents and channel statuses NEW = 0 # The entry is newly created and is not published yet. It will be committed at the next commit. diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/channel_peer.py b/src/tribler/core/components/metadata_store/db/orm_bindings/channel_peer.py similarity index 100% rename from src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/channel_peer.py rename to src/tribler/core/components/metadata_store/db/orm_bindings/channel_peer.py diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/channel_thumbnail.py b/src/tribler/core/components/metadata_store/db/orm_bindings/channel_thumbnail.py similarity index 79% rename from src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/channel_thumbnail.py rename to src/tribler/core/components/metadata_store/db/orm_bindings/channel_thumbnail.py index 68efd8df1f5..55f1f889745 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/channel_thumbnail.py +++ b/src/tribler/core/components/metadata_store/db/orm_bindings/channel_thumbnail.py @@ -1,4 +1,4 @@ -from tribler_core.components.metadata_store.db.serialization import CHANNEL_THUMBNAIL +from tribler.core.components.metadata_store.db.serialization import CHANNEL_THUMBNAIL def define_binding(db): diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/channel_vote.py b/src/tribler/core/components/metadata_store/db/orm_bindings/channel_vote.py similarity index 100% rename from src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/channel_vote.py rename to src/tribler/core/components/metadata_store/db/orm_bindings/channel_vote.py diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/collection_node.py b/src/tribler/core/components/metadata_store/db/orm_bindings/collection_node.py similarity index 97% rename from src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/collection_node.py rename to src/tribler/core/components/metadata_store/db/orm_bindings/collection_node.py index 6b7e3716aa2..aa4c6b7da44 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/collection_node.py +++ b/src/tribler/core/components/metadata_store/db/orm_bindings/collection_node.py @@ -4,9 +4,9 @@ from pony import orm from pony.orm import db_session, select -from tribler_core.components.libtorrent.torrentdef import TorrentDef -from tribler_core.components.metadata_store.db.orm_bindings.channel_metadata import chunks -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import ( +from tribler.core.components.libtorrent.torrentdef import TorrentDef +from tribler.core.components.metadata_store.db.orm_bindings.channel_metadata import chunks +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import ( CHANNEL_DESCRIPTION_FLAG, CHANNEL_THUMBNAIL_FLAG, COMMITTED, @@ -15,15 +15,15 @@ TODELETE, UPDATED, ) -from tribler_core.components.metadata_store.db.orm_bindings.discrete_clock import clock -from tribler_core.components.metadata_store.db.orm_bindings.torrent_metadata import tdef_to_metadata_dict -from tribler_core.components.metadata_store.db.serialization import ( +from tribler.core.components.metadata_store.db.orm_bindings.discrete_clock import clock +from tribler.core.components.metadata_store.db.orm_bindings.torrent_metadata import tdef_to_metadata_dict +from tribler.core.components.metadata_store.db.serialization import ( CHANNEL_TORRENT, COLLECTION_NODE, CollectionNodePayload, ) -from tribler_core.utilities.simpledefs import CHANNEL_STATE -from tribler_core.utilities.utilities import random_infohash +from tribler.core.utilities.simpledefs import CHANNEL_STATE +from tribler.core.utilities.utilities import random_infohash # pylint: disable=too-many-statements diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/discrete_clock.py b/src/tribler/core/components/metadata_store/db/orm_bindings/discrete_clock.py similarity index 92% rename from src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/discrete_clock.py rename to src/tribler/core/components/metadata_store/db/orm_bindings/discrete_clock.py index 387c7d2a1c4..73784b1641e 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/discrete_clock.py +++ b/src/tribler/core/components/metadata_store/db/orm_bindings/discrete_clock.py @@ -6,7 +6,7 @@ # not go backwards between Tribler restarts. from datetime import datetime -from tribler_core.components.metadata_store.db.serialization import time2int +from tribler.core.components.metadata_store.db.serialization import time2int class DiscreteClock: diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/json_node.py b/src/tribler/core/components/metadata_store/db/orm_bindings/json_node.py similarity index 93% rename from src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/json_node.py rename to src/tribler/core/components/metadata_store/db/orm_bindings/json_node.py index 20f2ba25b85..79f67b966cf 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/json_node.py +++ b/src/tribler/core/components/metadata_store/db/orm_bindings/json_node.py @@ -1,6 +1,6 @@ from pony.orm import Optional -from tribler_core.components.metadata_store.db.serialization import JSON_NODE, JsonNodePayload +from tribler.core.components.metadata_store.db.serialization import JSON_NODE, JsonNodePayload def define_binding(db, db_version: int): diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/metadata_node.py b/src/tribler/core/components/metadata_store/db/orm_bindings/metadata_node.py similarity index 96% rename from src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/metadata_node.py rename to src/tribler/core/components/metadata_store/db/orm_bindings/metadata_node.py index 98351b28a2d..2812b8e03ab 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/metadata_node.py +++ b/src/tribler/core/components/metadata_store/db/orm_bindings/metadata_node.py @@ -1,6 +1,6 @@ from pony import orm -from tribler_core.components.metadata_store.db.serialization import METADATA_NODE, MetadataNodePayload +from tribler.core.components.metadata_store.db.serialization import METADATA_NODE, MetadataNodePayload def define_binding(db): diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/misc.py b/src/tribler/core/components/metadata_store/db/orm_bindings/misc.py similarity index 100% rename from src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/misc.py rename to src/tribler/core/components/metadata_store/db/orm_bindings/misc.py diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/torrent_metadata.py b/src/tribler/core/components/metadata_store/db/orm_bindings/torrent_metadata.py similarity index 93% rename from src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/torrent_metadata.py rename to src/tribler/core/components/metadata_store/db/orm_bindings/torrent_metadata.py index f41c0cfaf40..e13b2d46a30 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/torrent_metadata.py +++ b/src/tribler/core/components/metadata_store/db/orm_bindings/torrent_metadata.py @@ -4,14 +4,14 @@ from pony import orm from pony.orm import db_session -from tribler_core import notifications -from tribler_core.components.metadata_store.category_filter.category import default_category_filter -from tribler_core.components.metadata_store.category_filter.family_filter import default_xxx_filter -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import COMMITTED -from tribler_core.components.metadata_store.db.serialization import EPOCH, REGULAR_TORRENT, TorrentMetadataPayload -from tribler_core.utilities.notifier import Notifier -from tribler_core.utilities.tracker_utils import get_uniformed_tracker_url -from tribler_core.utilities.unicode import ensure_unicode, hexlify +from tribler.core import notifications +from tribler.core.components.metadata_store.category_filter.category import default_category_filter +from tribler.core.components.metadata_store.category_filter.family_filter import default_xxx_filter +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import COMMITTED +from tribler.core.components.metadata_store.db.serialization import EPOCH, REGULAR_TORRENT, TorrentMetadataPayload +from tribler.core.utilities.notifier import Notifier +from tribler.core.utilities.tracker_utils import get_uniformed_tracker_url +from tribler.core.utilities.unicode import ensure_unicode, hexlify NULL_KEY_SUBST = b"\00" diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/torrent_state.py b/src/tribler/core/components/metadata_store/db/orm_bindings/torrent_state.py similarity index 100% rename from src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/torrent_state.py rename to src/tribler/core/components/metadata_store/db/orm_bindings/torrent_state.py diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/tracker_state.py b/src/tribler/core/components/metadata_store/db/orm_bindings/tracker_state.py similarity index 94% rename from src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/tracker_state.py rename to src/tribler/core/components/metadata_store/db/orm_bindings/tracker_state.py index 7904a8a2582..696668755b8 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/tracker_state.py +++ b/src/tribler/core/components/metadata_store/db/orm_bindings/tracker_state.py @@ -1,6 +1,6 @@ from pony import orm -from tribler_core.utilities.tracker_utils import MalformedTrackerURLException, get_uniformed_tracker_url +from tribler.core.utilities.tracker_utils import MalformedTrackerURLException, get_uniformed_tracker_url def define_binding(db): diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/vsids.py b/src/tribler/core/components/metadata_store/db/orm_bindings/vsids.py similarity index 98% rename from src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/vsids.py rename to src/tribler/core/components/metadata_store/db/orm_bindings/vsids.py index 49b256ebc69..515ad26ee1e 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/vsids.py +++ b/src/tribler/core/components/metadata_store/db/orm_bindings/vsids.py @@ -4,7 +4,7 @@ from pony import orm from pony.orm import db_session -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import LEGACY_ENTRY +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import LEGACY_ENTRY def define_binding(db): diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/serialization.py b/src/tribler/core/components/metadata_store/db/serialization.py similarity index 99% rename from src/tribler-core/tribler_core/components/metadata_store/db/serialization.py rename to src/tribler/core/components/metadata_store/db/serialization.py index 695f868c966..3570114f6e7 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/db/serialization.py +++ b/src/tribler/core/components/metadata_store/db/serialization.py @@ -9,8 +9,8 @@ from ipv8.messaging.payload import Payload from ipv8.messaging.serialization import default_serializer -from tribler_core.exceptions import InvalidSignatureException -from tribler_core.utilities.unicode import hexlify +from tribler.core.exceptions import InvalidSignatureException +from tribler.core.utilities.unicode import hexlify EPOCH = datetime(1970, 1, 1) diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/store.py b/src/tribler/core/components/metadata_store/db/store.py similarity index 97% rename from src/tribler-core/tribler_core/components/metadata_store/db/store.py rename to src/tribler/core/components/metadata_store/db/store.py index 16f0089970a..35126ad6c0b 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/db/store.py +++ b/src/tribler/core/components/metadata_store/db/store.py @@ -11,8 +11,8 @@ from pony import orm from pony.orm import db_session, desc, left_join, raw_sql, select -from tribler_core import notifications -from tribler_core.components.metadata_store.db.orm_bindings import ( +from tribler.core import notifications +from tribler.core.components.metadata_store.db.orm_bindings import ( binary_node, channel_description, channel_metadata, @@ -29,10 +29,10 @@ tracker_state, vsids, ) -from tribler_core.components.metadata_store.db.orm_bindings.channel_metadata import get_mdblob_sequence_number -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import LEGACY_ENTRY, TODELETE -from tribler_core.components.metadata_store.db.orm_bindings.torrent_metadata import NULL_KEY_SUBST -from tribler_core.components.metadata_store.db.serialization import ( +from tribler.core.components.metadata_store.db.orm_bindings.channel_metadata import get_mdblob_sequence_number +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import LEGACY_ENTRY, TODELETE +from tribler.core.components.metadata_store.db.orm_bindings.torrent_metadata import NULL_KEY_SUBST +from tribler.core.components.metadata_store.db.serialization import ( BINARY_NODE, CHANNEL_DESCRIPTION, CHANNEL_NODE, @@ -45,13 +45,13 @@ REGULAR_TORRENT, read_payload_with_offset, ) -from tribler_core.components.metadata_store.remote_query_community.payload_checker import process_payload -from tribler_core.exceptions import InvalidSignatureException -from tribler_core.utilities.notifier import Notifier -from tribler_core.utilities.path_util import Path -from tribler_core.utilities.pony_utils import get_or_create -from tribler_core.utilities.unicode import hexlify -from tribler_core.utilities.utilities import MEMORY_DB +from tribler.core.components.metadata_store.remote_query_community.payload_checker import process_payload +from tribler.core.exceptions import InvalidSignatureException +from tribler.core.utilities.notifier import Notifier +from tribler.core.utilities.path_util import Path +from tribler.core.utilities.pony_utils import get_or_create +from tribler.core.utilities.unicode import hexlify +from tribler.core.utilities.utilities import MEMORY_DB BETA_DB_VERSIONS = [0, 1, 2, 3, 4, 5] CURRENT_DB_VERSION = 14 diff --git a/src/tribler-core/tribler_core/components/metadata_store/remote_query_community/__init__.py b/src/tribler/core/components/metadata_store/db/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/metadata_store/remote_query_community/__init__.py rename to src/tribler/core/components/metadata_store/db/tests/__init__.py diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/tests/test_store.py b/src/tribler/core/components/metadata_store/db/tests/test_store.py similarity index 97% rename from src/tribler-core/tribler_core/components/metadata_store/db/tests/test_store.py rename to src/tribler/core/components/metadata_store/db/tests/test_store.py index ecc30fd647e..6763fd1efa4 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/db/tests/test_store.py +++ b/src/tribler/core/components/metadata_store/db/tests/test_store.py @@ -12,12 +12,12 @@ import pytest -from tribler_core.components.metadata_store.db.orm_bindings.channel_metadata import ( +from tribler.core.components.metadata_store.db.orm_bindings.channel_metadata import ( CHANNEL_DIR_NAME_LENGTH, entries_to_chunk, ) -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import NEW -from tribler_core.components.metadata_store.db.serialization import ( +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import NEW +from tribler.core.components.metadata_store.db.serialization import ( CHANNEL_TORRENT, ChannelMetadataPayload, DeletedMetadataPayload, @@ -25,11 +25,11 @@ UnknownBlobTypeException, int2time, ) -from tribler_core.components.metadata_store.remote_query_community.payload_checker import ObjState, ProcessingResult -from tribler_core.components.metadata_store.tests.test_channel_download import CHANNEL_METADATA_UPDATED -from tribler_core.tests.tools.common import TESTS_DATA_DIR -from tribler_core.utilities.path_util import Path -from tribler_core.utilities.utilities import random_infohash +from tribler.core.components.metadata_store.remote_query_community.payload_checker import ObjState, ProcessingResult +from tribler.core.components.metadata_store.tests.test_channel_download import CHANNEL_METADATA_UPDATED +from tribler.core.tests.tools.common import TESTS_DATA_DIR +from tribler.core.utilities.path_util import Path +from tribler.core.utilities.utilities import random_infohash # pylint: disable=protected-access,unused-argument diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/tests/test_torrent_metadata.py b/src/tribler/core/components/metadata_store/db/tests/test_torrent_metadata.py similarity index 96% rename from src/tribler-core/tribler_core/components/metadata_store/db/tests/test_torrent_metadata.py rename to src/tribler/core/components/metadata_store/db/tests/test_torrent_metadata.py index abb67c5dcd6..9fb5356e87a 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/db/tests/test_torrent_metadata.py +++ b/src/tribler/core/components/metadata_store/db/tests/test_torrent_metadata.py @@ -8,14 +8,14 @@ import pytest -from tribler_core.components.libtorrent.torrentdef import TorrentDef -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import TODELETE -from tribler_core.components.metadata_store.db.orm_bindings.discrete_clock import clock -from tribler_core.components.metadata_store.db.orm_bindings.torrent_metadata import tdef_to_metadata_dict -from tribler_core.components.metadata_store.db.serialization import CHANNEL_TORRENT, REGULAR_TORRENT -from tribler_core.conftest import TEST_PERSONAL_KEY -from tribler_core.tests.tools.common import TORRENT_UBUNTU_FILE -from tribler_core.utilities.utilities import random_infohash +from tribler.core.components.libtorrent.torrentdef import TorrentDef +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import TODELETE +from tribler.core.components.metadata_store.db.orm_bindings.discrete_clock import clock +from tribler.core.components.metadata_store.db.orm_bindings.torrent_metadata import tdef_to_metadata_dict +from tribler.core.components.metadata_store.db.serialization import CHANNEL_TORRENT, REGULAR_TORRENT +from tribler.core.conftest import TEST_PERSONAL_KEY +from tribler.core.tests.tools.common import TORRENT_UBUNTU_FILE +from tribler.core.utilities.utilities import random_infohash EMPTY_BLOB = b"" diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/tests/test_tracker_state.py b/src/tribler/core/components/metadata_store/db/tests/test_tracker_state.py similarity index 91% rename from src/tribler-core/tribler_core/components/metadata_store/db/tests/test_tracker_state.py rename to src/tribler/core/components/metadata_store/db/tests/test_tracker_state.py index a3d4b846a85..0b8572c27a8 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/db/tests/test_tracker_state.py +++ b/src/tribler/core/components/metadata_store/db/tests/test_tracker_state.py @@ -2,7 +2,7 @@ import pytest -from tribler_core.utilities.tracker_utils import MalformedTrackerURLException +from tribler.core.utilities.tracker_utils import MalformedTrackerURLException @db_session diff --git a/src/tribler-core/tribler_core/components/metadata_store/metadata_store_component.py b/src/tribler/core/components/metadata_store/metadata_store_component.py similarity index 85% rename from src/tribler-core/tribler_core/components/metadata_store/metadata_store_component.py rename to src/tribler/core/components/metadata_store/metadata_store_component.py index ea3245f58bd..7dc65d19a0c 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/metadata_store_component.py +++ b/src/tribler/core/components/metadata_store/metadata_store_component.py @@ -1,9 +1,9 @@ -from tribler_core import notifications -from tribler_core.components.base import Component -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.metadata_store.db.store import MetadataStore -from tribler_core.components.tag.rules.tag_rules_processor import TagRulesProcessor -from tribler_core.utilities.simpledefs import STATEDIR_DB_DIR +from tribler.core import notifications +from tribler.core.components.base import Component +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.metadata_store.db.store import MetadataStore +from tribler.core.components.tag.rules.tag_rules_processor import TagRulesProcessor +from tribler.core.utilities.simpledefs import STATEDIR_DB_DIR class MetadataStoreComponent(Component): diff --git a/src/tribler-core/tribler_core/components/metadata_store/remote_query_community/tests/__init__.py b/src/tribler/core/components/metadata_store/remote_query_community/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/metadata_store/remote_query_community/tests/__init__.py rename to src/tribler/core/components/metadata_store/remote_query_community/__init__.py diff --git a/src/tribler-core/tribler_core/components/metadata_store/remote_query_community/payload_checker.py b/src/tribler/core/components/metadata_store/remote_query_community/payload_checker.py similarity index 98% rename from src/tribler-core/tribler_core/components/metadata_store/remote_query_community/payload_checker.py rename to src/tribler/core/components/metadata_store/remote_query_community/payload_checker.py index f4dab87207b..93be96aef12 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/remote_query_community/payload_checker.py +++ b/src/tribler/core/components/metadata_store/remote_query_community/payload_checker.py @@ -3,8 +3,8 @@ from pony.orm import db_session -from tribler_core.components.metadata_store.category_filter.l2_filter import is_forbidden -from tribler_core.components.metadata_store.db.serialization import ( +from tribler.core.components.metadata_store.category_filter.l2_filter import is_forbidden +from tribler.core.components.metadata_store.db.serialization import ( CHANNEL_DESCRIPTION, CHANNEL_THUMBNAIL, CHANNEL_TORRENT, @@ -13,8 +13,8 @@ NULL_KEY, REGULAR_TORRENT, ) -from tribler_core.utilities.sentinels import sentinel -from tribler_core.utilities.unicode import hexlify +from tribler.core.utilities.sentinels import sentinel +from tribler.core.utilities.unicode import hexlify class ObjState(enum.Enum): diff --git a/src/tribler-core/tribler_core/components/metadata_store/remote_query_community/remote_query_community.py b/src/tribler/core/components/metadata_store/remote_query_community/remote_query_community.py similarity index 95% rename from src/tribler-core/tribler_core/components/metadata_store/remote_query_community/remote_query_community.py rename to src/tribler/core/components/metadata_store/remote_query_community/remote_query_community.py index cc25d9ee121..280bdfd8a3e 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/remote_query_community/remote_query_community.py +++ b/src/tribler/core/components/metadata_store/remote_query_community/remote_query_community.py @@ -11,16 +11,16 @@ from pony.orm import db_session from pony.orm.dbapiprovider import OperationalError -from tribler_core.components.ipv8.eva_protocol import EVAProtocolMixin -from tribler_core.components.ipv8.tribler_community import TriblerCommunity -from tribler_core.components.metadata_store.db.orm_bindings.channel_metadata import LZ4_EMPTY_ARCHIVE, entries_to_chunk -from tribler_core.components.metadata_store.db.serialization import CHANNEL_TORRENT, COLLECTION_NODE, REGULAR_TORRENT -from tribler_core.components.metadata_store.db.store import MetadataStore -from tribler_core.components.metadata_store.remote_query_community.payload_checker import ObjState -from tribler_core.components.metadata_store.remote_query_community.settings import RemoteQueryCommunitySettings -from tribler_core.components.metadata_store.utils import RequestTimeoutException -from tribler_core.components.tag.community.tag_validator import is_valid_tag -from tribler_core.utilities.unicode import hexlify +from tribler.core.components.ipv8.eva_protocol import EVAProtocolMixin +from tribler.core.components.ipv8.tribler_community import TriblerCommunity +from tribler.core.components.metadata_store.db.orm_bindings.channel_metadata import LZ4_EMPTY_ARCHIVE, entries_to_chunk +from tribler.core.components.metadata_store.db.serialization import CHANNEL_TORRENT, COLLECTION_NODE, REGULAR_TORRENT +from tribler.core.components.metadata_store.db.store import MetadataStore +from tribler.core.components.metadata_store.remote_query_community.payload_checker import ObjState +from tribler.core.components.metadata_store.remote_query_community.settings import RemoteQueryCommunitySettings +from tribler.core.components.metadata_store.utils import RequestTimeoutException +from tribler.core.components.tag.community.tag_validator import is_valid_tag +from tribler.core.utilities.unicode import hexlify BINARY_FIELDS = ("infohash", "channel_pk") diff --git a/src/tribler-core/tribler_core/components/metadata_store/remote_query_community/settings.py b/src/tribler/core/components/metadata_store/remote_query_community/settings.py similarity index 89% rename from src/tribler-core/tribler_core/components/metadata_store/remote_query_community/settings.py rename to src/tribler/core/components/metadata_store/remote_query_community/settings.py index 20ff05b7129..ea380da426e 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/remote_query_community/settings.py +++ b/src/tribler/core/components/metadata_store/remote_query_community/settings.py @@ -1,4 +1,4 @@ -from tribler_core.config.tribler_config_section import TriblerConfigSection +from tribler.core.config.tribler_config_section import TriblerConfigSection class RemoteQueryCommunitySettings(TriblerConfigSection): diff --git a/src/tribler-core/tribler_core/components/metadata_store/restapi/__init__.py b/src/tribler/core/components/metadata_store/remote_query_community/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/metadata_store/restapi/__init__.py rename to src/tribler/core/components/metadata_store/remote_query_community/tests/__init__.py diff --git a/src/tribler-core/tribler_core/components/metadata_store/remote_query_community/tests/test_remote_query_community.py b/src/tribler/core/components/metadata_store/remote_query_community/tests/test_remote_query_community.py similarity index 97% rename from src/tribler-core/tribler_core/components/metadata_store/remote_query_community/tests/test_remote_query_community.py rename to src/tribler/core/components/metadata_store/remote_query_community/tests/test_remote_query_community.py index 0de640aecd2..65ad9879e97 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/remote_query_community/tests/test_remote_query_community.py +++ b/src/tribler/core/components/metadata_store/remote_query_community/tests/test_remote_query_community.py @@ -17,17 +17,17 @@ import pytest -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import NEW -from tribler_core.components.metadata_store.db.serialization import CHANNEL_THUMBNAIL, CHANNEL_TORRENT, REGULAR_TORRENT -from tribler_core.components.metadata_store.db.store import MetadataStore -from tribler_core.components.metadata_store.remote_query_community.remote_query_community import ( +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import NEW +from tribler.core.components.metadata_store.db.serialization import CHANNEL_THUMBNAIL, CHANNEL_TORRENT, REGULAR_TORRENT +from tribler.core.components.metadata_store.db.store import MetadataStore +from tribler.core.components.metadata_store.remote_query_community.remote_query_community import ( RemoteQueryCommunity, sanitize_query, ) -from tribler_core.components.metadata_store.remote_query_community.settings import RemoteQueryCommunitySettings -from tribler_core.utilities.path_util import Path -from tribler_core.utilities.unicode import hexlify -from tribler_core.utilities.utilities import random_infohash +from tribler.core.components.metadata_store.remote_query_community.settings import RemoteQueryCommunitySettings +from tribler.core.utilities.path_util import Path +from tribler.core.utilities.unicode import hexlify +from tribler.core.utilities.utilities import random_infohash # pylint: disable=protected-access @@ -533,7 +533,7 @@ async def test_drop_silent_peer(self): kwargs_dict = {"txt_filter": "ubuntu*"} - basic_path = 'tribler_core.components.metadata_store.remote_query_community.remote_query_community' + basic_path = 'tribler.core.components.metadata_store.remote_query_community.remote_query_community' with self.overlay(1).request_cache.passthrough(): # Stop peer 0 from responding diff --git a/src/tribler-core/tribler_core/components/metadata_store/remote_query_community/tests/test_remote_search_by_tags.py b/src/tribler/core/components/metadata_store/remote_query_community/tests/test_remote_search_by_tags.py similarity index 90% rename from src/tribler-core/tribler_core/components/metadata_store/remote_query_community/tests/test_remote_search_by_tags.py rename to src/tribler/core/components/metadata_store/remote_query_community/tests/test_remote_search_by_tags.py index 09e83b61511..7859cce1af1 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/remote_query_community/tests/test_remote_search_by_tags.py +++ b/src/tribler/core/components/metadata_store/remote_query_community/tests/test_remote_search_by_tags.py @@ -6,16 +6,16 @@ from pony.orm import db_session -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import NEW -from tribler_core.components.metadata_store.db.store import MetadataStore -from tribler_core.components.metadata_store.remote_query_community.remote_query_community import RemoteQueryCommunity -from tribler_core.components.metadata_store.remote_query_community.settings import RemoteQueryCommunitySettings -from tribler_core.components.metadata_store.remote_query_community.tests.test_remote_query_community import ( +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import NEW +from tribler.core.components.metadata_store.db.store import MetadataStore +from tribler.core.components.metadata_store.remote_query_community.remote_query_community import RemoteQueryCommunity +from tribler.core.components.metadata_store.remote_query_community.settings import RemoteQueryCommunitySettings +from tribler.core.components.metadata_store.remote_query_community.tests.test_remote_query_community import ( BasicRemoteQueryCommunity, ) -from tribler_core.components.tag.db.tag_db import SHOW_THRESHOLD, TagDatabase -from tribler_core.components.tag.db.tests.test_tag_db import Tag, TestTagDB -from tribler_core.utilities.path_util import Path +from tribler.core.components.tag.db.tag_db import SHOW_THRESHOLD, TagDatabase +from tribler.core.components.tag.db.tests.test_tag_db import Tag, TestTagDB +from tribler.core.utilities.path_util import Path class TestRemoteSearchByTags(TestBase): diff --git a/src/tribler-core/tribler_core/components/metadata_store/restapi/tests/__init__.py b/src/tribler/core/components/metadata_store/restapi/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/metadata_store/restapi/tests/__init__.py rename to src/tribler/core/components/metadata_store/restapi/__init__.py diff --git a/src/tribler-core/tribler_core/components/metadata_store/restapi/channels_endpoint.py b/src/tribler/core/components/metadata_store/restapi/channels_endpoint.py similarity index 96% rename from src/tribler-core/tribler_core/components/metadata_store/restapi/channels_endpoint.py rename to src/tribler/core/components/metadata_store/restapi/channels_endpoint.py index f2ad41f0f74..3f9fbd2c094 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/restapi/channels_endpoint.py +++ b/src/tribler/core/components/metadata_store/restapi/channels_endpoint.py @@ -15,20 +15,20 @@ from pony.orm import db_session -from tribler_core.components.gigachannel.community.gigachannel_community import GigaChannelCommunity -from tribler_core.components.gigachannel_manager.gigachannel_manager import GigaChannelManager -from tribler_core.components.libtorrent.download_manager.download_manager import DownloadManager -from tribler_core.components.libtorrent.torrentdef import TorrentDef -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import DIRTY_STATUSES, NEW -from tribler_core.components.metadata_store.db.serialization import CHANNEL_TORRENT, REGULAR_TORRENT -from tribler_core.components.metadata_store.restapi.metadata_endpoint_base import MetadataEndpointBase -from tribler_core.components.metadata_store.restapi.metadata_schema import ChannelSchema, MetadataSchema, TorrentSchema -from tribler_core.components.metadata_store.utils import NoChannelSourcesException, RequestTimeoutException -from tribler_core.components.restapi.rest.rest_endpoint import HTTP_BAD_REQUEST, HTTP_NOT_FOUND, RESTResponse -from tribler_core.components.restapi.rest.schema import HandledErrorSchema -from tribler_core.utilities.simpledefs import CHANNEL_STATE -from tribler_core.utilities.unicode import hexlify -from tribler_core.utilities.utilities import froze_it, is_infohash, parse_magnetlink +from tribler.core.components.gigachannel.community.gigachannel_community import GigaChannelCommunity +from tribler.core.components.gigachannel_manager.gigachannel_manager import GigaChannelManager +from tribler.core.components.libtorrent.download_manager.download_manager import DownloadManager +from tribler.core.components.libtorrent.torrentdef import TorrentDef +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import DIRTY_STATUSES, NEW +from tribler.core.components.metadata_store.db.serialization import CHANNEL_TORRENT, REGULAR_TORRENT +from tribler.core.components.metadata_store.restapi.metadata_endpoint_base import MetadataEndpointBase +from tribler.core.components.metadata_store.restapi.metadata_schema import ChannelSchema, MetadataSchema, TorrentSchema +from tribler.core.components.metadata_store.utils import NoChannelSourcesException, RequestTimeoutException +from tribler.core.components.restapi.rest.rest_endpoint import HTTP_BAD_REQUEST, HTTP_NOT_FOUND, RESTResponse +from tribler.core.components.restapi.rest.schema import HandledErrorSchema +from tribler.core.utilities.simpledefs import CHANNEL_STATE +from tribler.core.utilities.unicode import hexlify +from tribler.core.utilities.utilities import froze_it, is_infohash, parse_magnetlink async def _fetch_uri(uri): diff --git a/src/tribler-core/tribler_core/components/metadata_store/restapi/metadata_endpoint.py b/src/tribler/core/components/metadata_store/restapi/metadata_endpoint.py similarity index 95% rename from src/tribler-core/tribler_core/components/metadata_store/restapi/metadata_endpoint.py rename to src/tribler/core/components/metadata_store/restapi/metadata_endpoint.py index 6374565d697..48be6e537f2 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/restapi/metadata_endpoint.py +++ b/src/tribler/core/components/metadata_store/restapi/metadata_endpoint.py @@ -11,13 +11,13 @@ from pony.orm import db_session -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import LEGACY_ENTRY -from tribler_core.components.metadata_store.restapi.metadata_endpoint_base import MetadataEndpointBase -from tribler_core.components.restapi.rest.rest_endpoint import RESTResponse -from tribler_core.components.restapi.rest.schema import HandledErrorSchema -from tribler_core.components.torrent_checker.torrent_checker.torrent_checker import TorrentChecker -from tribler_core.utilities.unicode import hexlify -from tribler_core.utilities.utilities import froze_it +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import LEGACY_ENTRY +from tribler.core.components.metadata_store.restapi.metadata_endpoint_base import MetadataEndpointBase +from tribler.core.components.restapi.rest.rest_endpoint import RESTResponse +from tribler.core.components.restapi.rest.schema import HandledErrorSchema +from tribler.core.components.torrent_checker.torrent_checker.torrent_checker import TorrentChecker +from tribler.core.utilities.unicode import hexlify +from tribler.core.utilities.utilities import froze_it TORRENT_CHECK_TIMEOUT = 20 diff --git a/src/tribler-core/tribler_core/components/metadata_store/restapi/metadata_endpoint_base.py b/src/tribler/core/components/metadata_store/restapi/metadata_endpoint_base.py similarity index 91% rename from src/tribler-core/tribler_core/components/metadata_store/restapi/metadata_endpoint_base.py rename to src/tribler/core/components/metadata_store/restapi/metadata_endpoint_base.py index 9df27489d7b..1e235198f46 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/restapi/metadata_endpoint_base.py +++ b/src/tribler/core/components/metadata_store/restapi/metadata_endpoint_base.py @@ -3,12 +3,12 @@ from pony.orm import db_session -from tribler_core.components.metadata_store.category_filter.family_filter import default_xxx_filter -from tribler_core.components.metadata_store.db.serialization import CHANNEL_TORRENT, COLLECTION_NODE, REGULAR_TORRENT -from tribler_core.components.metadata_store.db.store import MetadataStore -from tribler_core.components.restapi.rest.rest_endpoint import RESTEndpoint -from tribler_core.components.tag.db.tag_db import TagDatabase -from tribler_core.components.tag.rules.tag_rules_processor import TagRulesProcessor +from tribler.core.components.metadata_store.category_filter.family_filter import default_xxx_filter +from tribler.core.components.metadata_store.db.serialization import CHANNEL_TORRENT, COLLECTION_NODE, REGULAR_TORRENT +from tribler.core.components.metadata_store.db.store import MetadataStore +from tribler.core.components.restapi.rest.rest_endpoint import RESTEndpoint +from tribler.core.components.tag.db.tag_db import TagDatabase +from tribler.core.components.tag.rules.tag_rules_processor import TagRulesProcessor # This dict is used to translate JSON fields into the columns used in Pony for _sorting_. # id_ is not in the list because there is not index on it, so we never really want to sort on it. diff --git a/src/tribler-core/tribler_core/components/metadata_store/restapi/metadata_schema.py b/src/tribler/core/components/metadata_store/restapi/metadata_schema.py similarity index 100% rename from src/tribler-core/tribler_core/components/metadata_store/restapi/metadata_schema.py rename to src/tribler/core/components/metadata_store/restapi/metadata_schema.py diff --git a/src/tribler-core/tribler_core/components/metadata_store/restapi/remote_query_endpoint.py b/src/tribler/core/components/metadata_store/restapi/remote_query_endpoint.py similarity index 90% rename from src/tribler-core/tribler_core/components/metadata_store/restapi/remote_query_endpoint.py rename to src/tribler/core/components/metadata_store/restapi/remote_query_endpoint.py index 56c3fac2e32..87fa1ab3428 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/restapi/remote_query_endpoint.py +++ b/src/tribler/core/components/metadata_store/restapi/remote_query_endpoint.py @@ -11,12 +11,12 @@ from pony.orm import db_session -from tribler_core.components.gigachannel.community.gigachannel_community import GigaChannelCommunity -from tribler_core.components.metadata_store.restapi.metadata_endpoint import MetadataEndpointBase -from tribler_core.components.metadata_store.restapi.metadata_schema import RemoteQueryParameters -from tribler_core.components.restapi.rest.rest_endpoint import HTTP_BAD_REQUEST, RESTResponse -from tribler_core.utilities.unicode import hexlify -from tribler_core.utilities.utilities import froze_it +from tribler.core.components.gigachannel.community.gigachannel_community import GigaChannelCommunity +from tribler.core.components.metadata_store.restapi.metadata_endpoint import MetadataEndpointBase +from tribler.core.components.metadata_store.restapi.metadata_schema import RemoteQueryParameters +from tribler.core.components.restapi.rest.rest_endpoint import HTTP_BAD_REQUEST, RESTResponse +from tribler.core.utilities.unicode import hexlify +from tribler.core.utilities.utilities import froze_it @froze_it diff --git a/src/tribler-core/tribler_core/components/metadata_store/restapi/search_endpoint.py b/src/tribler/core/components/metadata_store/restapi/search_endpoint.py similarity index 93% rename from src/tribler-core/tribler_core/components/metadata_store/restapi/search_endpoint.py rename to src/tribler/core/components/metadata_store/restapi/search_endpoint.py index 6ba6df171df..7b0ddc0aba4 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/restapi/search_endpoint.py +++ b/src/tribler/core/components/metadata_store/restapi/search_endpoint.py @@ -8,11 +8,11 @@ from pony.orm import db_session -from tribler_core.components.metadata_store.db.store import MetadataStore -from tribler_core.components.metadata_store.restapi.metadata_endpoint import MetadataEndpointBase -from tribler_core.components.metadata_store.restapi.metadata_schema import MetadataParameters, MetadataSchema -from tribler_core.components.restapi.rest.rest_endpoint import HTTP_BAD_REQUEST, RESTResponse -from tribler_core.utilities.utilities import froze_it +from tribler.core.components.metadata_store.db.store import MetadataStore +from tribler.core.components.metadata_store.restapi.metadata_endpoint import MetadataEndpointBase +from tribler.core.components.metadata_store.restapi.metadata_schema import MetadataParameters, MetadataSchema +from tribler.core.components.restapi.rest.rest_endpoint import HTTP_BAD_REQUEST, RESTResponse +from tribler.core.utilities.utilities import froze_it @froze_it diff --git a/src/tribler-core/tribler_core/components/metadata_store/tests/__init__.py b/src/tribler/core/components/metadata_store/restapi/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/metadata_store/tests/__init__.py rename to src/tribler/core/components/metadata_store/restapi/tests/__init__.py diff --git a/src/tribler-core/tribler_core/components/metadata_store/restapi/tests/conftest.py b/src/tribler/core/components/metadata_store/restapi/tests/conftest.py similarity index 93% rename from src/tribler-core/tribler_core/components/metadata_store/restapi/tests/conftest.py rename to src/tribler/core/components/metadata_store/restapi/tests/conftest.py index 3ca186d373a..c66076a5bd5 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/restapi/tests/conftest.py +++ b/src/tribler/core/components/metadata_store/restapi/tests/conftest.py @@ -6,9 +6,9 @@ import pytest -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import NEW -from tribler_core.components.metadata_store.utils import tag_torrent -from tribler_core.utilities.utilities import random_infohash +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import NEW +from tribler.core.components.metadata_store.utils import tag_torrent +from tribler.core.utilities.utilities import random_infohash @pytest.fixture diff --git a/src/tribler-core/tribler_core/components/metadata_store/restapi/tests/test_channels_endpoint.py b/src/tribler/core/components/metadata_store/restapi/tests/test_channels_endpoint.py similarity index 96% rename from src/tribler-core/tribler_core/components/metadata_store/restapi/tests/test_channels_endpoint.py rename to src/tribler/core/components/metadata_store/restapi/tests/test_channels_endpoint.py index 8dc4e1a0dfd..b6f69e6d2b3 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/restapi/tests/test_channels_endpoint.py +++ b/src/tribler/core/components/metadata_store/restapi/tests/test_channels_endpoint.py @@ -12,19 +12,19 @@ import pytest -from tribler_core.components.gigachannel.community.gigachannel_community import NoChannelSourcesException -from tribler_core.components.libtorrent.torrentdef import TorrentDef -from tribler_core.components.metadata_store.category_filter.family_filter import default_xxx_filter -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import NEW -from tribler_core.components.metadata_store.db.serialization import CHANNEL_TORRENT, COLLECTION_NODE, REGULAR_TORRENT -from tribler_core.components.metadata_store.restapi.channels_endpoint import ChannelsEndpoint -from tribler_core.components.metadata_store.utils import RequestTimeoutException, tag_torrent -from tribler_core.components.restapi.rest.base_api_test import do_request -from tribler_core.components.restapi.rest.rest_manager import error_middleware -from tribler_core.tests.tools.common import TORRENT_UBUNTU_FILE -from tribler_core.utilities.simpledefs import CHANNEL_STATE -from tribler_core.utilities.unicode import hexlify -from tribler_core.utilities.utilities import random_infohash +from tribler.core.components.gigachannel.community.gigachannel_community import NoChannelSourcesException +from tribler.core.components.libtorrent.torrentdef import TorrentDef +from tribler.core.components.metadata_store.category_filter.family_filter import default_xxx_filter +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import NEW +from tribler.core.components.metadata_store.db.serialization import CHANNEL_TORRENT, COLLECTION_NODE, REGULAR_TORRENT +from tribler.core.components.metadata_store.restapi.channels_endpoint import ChannelsEndpoint +from tribler.core.components.metadata_store.utils import RequestTimeoutException, tag_torrent +from tribler.core.components.restapi.rest.base_api_test import do_request +from tribler.core.components.restapi.rest.rest_manager import error_middleware +from tribler.core.tests.tools.common import TORRENT_UBUNTU_FILE +from tribler.core.utilities.simpledefs import CHANNEL_STATE +from tribler.core.utilities.unicode import hexlify +from tribler.core.utilities.utilities import random_infohash PNG_DATA = unhexlify( "89504e470d0a1a0a0000000d494844520" @@ -565,7 +565,7 @@ async def _mock_fetch(*args): with open(TORRENT_UBUNTU_FILE, 'rb') as f: return f.read() - with patch('tribler_core.components.metadata_store.restapi.channels_endpoint._fetch_uri', new=_mock_fetch): + with patch('tribler.core.components.metadata_store.restapi.channels_endpoint._fetch_uri', new=_mock_fetch): await do_request( rest_api, f'channels/{hexlify(my_channel.public_key)}/{my_channel.id_}/torrents', diff --git a/src/tribler-core/tribler_core/components/metadata_store/restapi/tests/test_metadata_endpoint.py b/src/tribler/core/components/metadata_store/restapi/tests/test_metadata_endpoint.py similarity index 94% rename from src/tribler-core/tribler_core/components/metadata_store/restapi/tests/test_metadata_endpoint.py rename to src/tribler/core/components/metadata_store/restapi/tests/test_metadata_endpoint.py index e35d79f1a32..636270b79bd 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/restapi/tests/test_metadata_endpoint.py +++ b/src/tribler/core/components/metadata_store/restapi/tests/test_metadata_endpoint.py @@ -9,14 +9,14 @@ import pytest -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import COMMITTED, TODELETE, UPDATED -from tribler_core.components.metadata_store.restapi.metadata_endpoint import MetadataEndpoint, TORRENT_CHECK_TIMEOUT -from tribler_core.components.restapi.rest.base_api_test import do_request -from tribler_core.components.restapi.rest.rest_manager import error_middleware -from tribler_core.components.torrent_checker.torrent_checker.torrent_checker import TorrentChecker -from tribler_core.config.tribler_config import TriblerConfig -from tribler_core.utilities.unicode import hexlify -from tribler_core.utilities.utilities import has_bep33_support, random_infohash +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import COMMITTED, TODELETE, UPDATED +from tribler.core.components.metadata_store.restapi.metadata_endpoint import MetadataEndpoint, TORRENT_CHECK_TIMEOUT +from tribler.core.components.restapi.rest.base_api_test import do_request +from tribler.core.components.restapi.rest.rest_manager import error_middleware +from tribler.core.components.torrent_checker.torrent_checker.torrent_checker import TorrentChecker +from tribler.core.config.tribler_config import TriblerConfig +from tribler.core.utilities.unicode import hexlify +from tribler.core.utilities.utilities import has_bep33_support, random_infohash # pylint: disable=unused-argument diff --git a/src/tribler-core/tribler_core/components/metadata_store/restapi/tests/test_remote_query_endpoint.py b/src/tribler/core/components/metadata_store/restapi/tests/test_remote_query_endpoint.py similarity index 89% rename from src/tribler-core/tribler_core/components/metadata_store/restapi/tests/test_remote_query_endpoint.py rename to src/tribler/core/components/metadata_store/restapi/tests/test_remote_query_endpoint.py index 5cb8d31482f..131c4640eb7 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/restapi/tests/test_remote_query_endpoint.py +++ b/src/tribler/core/components/metadata_store/restapi/tests/test_remote_query_endpoint.py @@ -10,12 +10,12 @@ import pytest -from tribler_core.components.gigachannel.community.gigachannel_community import ChannelsPeersMapping -from tribler_core.components.metadata_store.restapi.remote_query_endpoint import RemoteQueryEndpoint -from tribler_core.components.restapi.rest.base_api_test import do_request -from tribler_core.components.restapi.rest.rest_manager import error_middleware -from tribler_core.utilities.unicode import hexlify -from tribler_core.utilities.utilities import random_infohash +from tribler.core.components.gigachannel.community.gigachannel_community import ChannelsPeersMapping +from tribler.core.components.metadata_store.restapi.remote_query_endpoint import RemoteQueryEndpoint +from tribler.core.components.restapi.rest.base_api_test import do_request +from tribler.core.components.restapi.rest.rest_manager import error_middleware +from tribler.core.utilities.unicode import hexlify +from tribler.core.utilities.utilities import random_infohash # pylint: disable=unused-argument diff --git a/src/tribler-core/tribler_core/components/metadata_store/restapi/tests/test_search_endpoint.py b/src/tribler/core/components/metadata_store/restapi/tests/test_search_endpoint.py similarity index 96% rename from src/tribler-core/tribler_core/components/metadata_store/restapi/tests/test_search_endpoint.py rename to src/tribler/core/components/metadata_store/restapi/tests/test_search_endpoint.py index c915d97cc54..d0561e6fae5 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/restapi/tests/test_search_endpoint.py +++ b/src/tribler/core/components/metadata_store/restapi/tests/test_search_endpoint.py @@ -7,10 +7,10 @@ import pytest -from tribler_core.components.metadata_store.restapi.search_endpoint import SearchEndpoint -from tribler_core.components.restapi.rest.base_api_test import do_request -from tribler_core.components.tag.db.tag_db import TagDatabase -from tribler_core.utilities.utilities import random_infohash, to_fts_query +from tribler.core.components.metadata_store.restapi.search_endpoint import SearchEndpoint +from tribler.core.components.restapi.rest.base_api_test import do_request +from tribler.core.components.tag.db.tag_db import TagDatabase +from tribler.core.utilities.utilities import random_infohash, to_fts_query # pylint: disable=unused-argument, redefined-outer-name diff --git a/src/tribler-core/tribler_core/components/payout/__init__.py b/src/tribler/core/components/metadata_store/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/payout/__init__.py rename to src/tribler/core/components/metadata_store/tests/__init__.py diff --git a/src/tribler-core/tribler_core/components/metadata_store/tests/gen_test_data.py b/src/tribler/core/components/metadata_store/tests/gen_test_data.py similarity index 85% rename from src/tribler-core/tribler_core/components/metadata_store/tests/gen_test_data.py rename to src/tribler/core/components/metadata_store/tests/gen_test_data.py index 54c0b211f8a..1608fa1ed4a 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/tests/gen_test_data.py +++ b/src/tribler/core/components/metadata_store/tests/gen_test_data.py @@ -6,18 +6,18 @@ from pony.orm import db_session -from tribler_core.components.libtorrent.torrentdef import TorrentDef -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import NEW -from tribler_core.components.metadata_store.db.store import MetadataStore -from tribler_core.components.metadata_store.tests.test_channel_download import ( +from tribler.core.components.libtorrent.torrentdef import TorrentDef +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import NEW +from tribler.core.components.metadata_store.db.store import MetadataStore +from tribler.core.components.metadata_store.tests.test_channel_download import ( CHANNEL_METADATA, CHANNEL_METADATA_UPDATED, CHANNEL_TORRENT, CHANNEL_TORRENT_UPDATED, ) -from tribler_core.tests.tools.common import TORRENT_UBUNTU_FILE, TORRENT_VIDEO_FILE -from tribler_core.utilities.path_util import Path -from tribler_core.utilities.utilities import MEMORY_DB +from tribler.core.tests.tools.common import TORRENT_UBUNTU_FILE, TORRENT_VIDEO_FILE +from tribler.core.utilities.path_util import Path +from tribler.core.utilities.utilities import MEMORY_DB DATA_DIR = Path(__file__).parent / '..' / '..' / 'data' SAMPLE_DIR = DATA_DIR / 'sample_channel' diff --git a/src/tribler-core/tribler_core/components/metadata_store/tests/test_channel_download.py b/src/tribler/core/components/metadata_store/tests/test_channel_download.py similarity index 88% rename from src/tribler-core/tribler_core/components/metadata_store/tests/test_channel_download.py rename to src/tribler/core/components/metadata_store/tests/test_channel_download.py index 6d5d2d54d98..5d947175733 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/tests/test_channel_download.py +++ b/src/tribler/core/components/metadata_store/tests/test_channel_download.py @@ -6,14 +6,14 @@ import pytest -from tribler_core.components.gigachannel_manager.gigachannel_manager import GigaChannelManager -from tribler_core.components.libtorrent.download_manager.download_config import DownloadConfig -from tribler_core.components.libtorrent.download_manager.download_manager import DownloadManager -from tribler_core.components.libtorrent.settings import LibtorrentSettings -from tribler_core.components.libtorrent.torrentdef import TorrentDef -from tribler_core.components.metadata_store.db.serialization import ChannelMetadataPayload -from tribler_core.tests.tools.common import TESTS_DATA_DIR -from tribler_core.utilities.simpledefs import DLSTATUS_SEEDING +from tribler.core.components.gigachannel_manager.gigachannel_manager import GigaChannelManager +from tribler.core.components.libtorrent.download_manager.download_config import DownloadConfig +from tribler.core.components.libtorrent.download_manager.download_manager import DownloadManager +from tribler.core.components.libtorrent.settings import LibtorrentSettings +from tribler.core.components.libtorrent.torrentdef import TorrentDef +from tribler.core.components.metadata_store.db.serialization import ChannelMetadataPayload +from tribler.core.tests.tools.common import TESTS_DATA_DIR +from tribler.core.utilities.simpledefs import DLSTATUS_SEEDING CHANNEL_DIR = TESTS_DATA_DIR / 'sample_channel' CHANNEL_TORRENT = CHANNEL_DIR / 'channel.torrent' diff --git a/src/tribler-core/tribler_core/components/metadata_store/tests/test_channel_metadata.py b/src/tribler/core/components/metadata_store/tests/test_channel_metadata.py similarity index 98% rename from src/tribler-core/tribler_core/components/metadata_store/tests/test_channel_metadata.py rename to src/tribler/core/components/metadata_store/tests/test_channel_metadata.py index 38103f601c4..2edce80dfda 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/tests/test_channel_metadata.py +++ b/src/tribler/core/components/metadata_store/tests/test_channel_metadata.py @@ -13,23 +13,23 @@ import pytest -from tribler_core.components.libtorrent.torrentdef import TorrentDef -from tribler_core.components.metadata_store.db.orm_bindings.channel_metadata import ( +from tribler.core.components.libtorrent.torrentdef import TorrentDef +from tribler.core.components.metadata_store.db.orm_bindings.channel_metadata import ( CHANNEL_DIR_NAME_LENGTH, MetadataCompressor, entries_to_chunk, ) -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import COMMITTED, NEW, TODELETE, UPDATED -from tribler_core.components.metadata_store.db.serialization import ( +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import COMMITTED, NEW, TODELETE, UPDATED +from tribler.core.components.metadata_store.db.serialization import ( CHANNEL_TORRENT, COLLECTION_NODE, REGULAR_TORRENT, int2time, ) -from tribler_core.components.metadata_store.db.store import HealthItemsPayload -from tribler_core.tests.tools.common import TESTS_DATA_DIR, TORRENT_UBUNTU_FILE -from tribler_core.utilities.simpledefs import CHANNEL_STATE -from tribler_core.utilities.utilities import random_infohash +from tribler.core.components.metadata_store.db.store import HealthItemsPayload +from tribler.core.tests.tools.common import TESTS_DATA_DIR, TORRENT_UBUNTU_FILE +from tribler.core.utilities.simpledefs import CHANNEL_STATE +from tribler.core.utilities.utilities import random_infohash # pylint: disable=protected-access diff --git a/src/tribler-core/tribler_core/components/metadata_store/tests/test_metadata.py b/src/tribler/core/components/metadata_store/tests/test_metadata.py similarity index 96% rename from src/tribler-core/tribler_core/components/metadata_store/tests/test_metadata.py rename to src/tribler/core/components/metadata_store/tests/test_metadata.py index 0a4c1786284..434c28ab94d 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/tests/test_metadata.py +++ b/src/tribler/core/components/metadata_store/tests/test_metadata.py @@ -5,15 +5,15 @@ import pytest -from tribler_core.exceptions import InvalidChannelNodeException, InvalidSignatureException -from tribler_core.components.metadata_store.db.serialization import ( +from tribler.core.exceptions import InvalidChannelNodeException, InvalidSignatureException +from tribler.core.components.metadata_store.db.serialization import ( CHANNEL_NODE, ChannelNodePayload, KeysMismatchException, NULL_KEY, NULL_SIG, ) -from tribler_core.utilities.unicode import hexlify +from tribler.core.utilities.unicode import hexlify @db_session diff --git a/src/tribler-core/tribler_core/components/metadata_store/tests/test_metadata_store_component.py b/src/tribler/core/components/metadata_store/tests/test_metadata_store_component.py similarity index 61% rename from src/tribler-core/tribler_core/components/metadata_store/tests/test_metadata_store_component.py rename to src/tribler/core/components/metadata_store/tests/test_metadata_store_component.py index 12b1cf80490..8f10b6c104a 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/tests/test_metadata_store_component.py +++ b/src/tribler/core/components/metadata_store/tests/test_metadata_store_component.py @@ -1,10 +1,10 @@ import pytest -from tribler_core.components.base import Session -from tribler_core.components.ipv8.ipv8_component import Ipv8Component -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent -from tribler_core.components.tag.tag_component import TagComponent +from tribler.core.components.base import Session +from tribler.core.components.ipv8.ipv8_component import Ipv8Component +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.metadata_store.metadata_store_component import MetadataStoreComponent +from tribler.core.components.tag.tag_component import TagComponent # pylint: disable=protected-access diff --git a/src/tribler-core/tribler_core/components/metadata_store/tests/test_timeutils.py b/src/tribler/core/components/metadata_store/tests/test_timeutils.py similarity index 92% rename from src/tribler-core/tribler_core/components/metadata_store/tests/test_timeutils.py rename to src/tribler/core/components/metadata_store/tests/test_timeutils.py index 2a9c4fdef91..f255c9940c8 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/tests/test_timeutils.py +++ b/src/tribler/core/components/metadata_store/tests/test_timeutils.py @@ -1,6 +1,6 @@ import datetime -from tribler_core.components.metadata_store.db.serialization import EPOCH, int2time, time2int +from tribler.core.components.metadata_store.db.serialization import EPOCH, int2time, time2int def test_time_convert(): diff --git a/src/tribler-core/tribler_core/components/metadata_store/utils.py b/src/tribler/core/components/metadata_store/utils.py similarity index 92% rename from src/tribler-core/tribler_core/components/metadata_store/utils.py rename to src/tribler/core/components/metadata_store/utils.py index f2d7589a2fe..dfd43d34142 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/utils.py +++ b/src/tribler/core/components/metadata_store/utils.py @@ -7,12 +7,12 @@ from pony.orm import db_session -from tribler_core.components.metadata_store.db.store import MetadataStore -from tribler_core.components.tag.community.tag_payload import TagOperation -from tribler_core.components.tag.db.tag_db import TagDatabase, TagOperationEnum -from tribler_core.components.tag.tag_constants import MIN_TAG_LENGTH -from tribler_core.tests.tools.common import PNG_FILE -from tribler_core.utilities.utilities import random_infohash +from tribler.core.components.metadata_store.db.store import MetadataStore +from tribler.core.components.tag.community.tag_payload import TagOperation +from tribler.core.components.tag.db.tag_db import TagDatabase, TagOperationEnum +from tribler.core.components.tag.tag_constants import MIN_TAG_LENGTH +from tribler.core.tests.tools.common import PNG_FILE +from tribler.core.utilities.utilities import random_infohash # Some random keys used for generating tags. random_key_1 = default_eccrypto.generate_key('low') diff --git a/src/tribler-core/tribler_core/components/payout/tests/__init__.py b/src/tribler/core/components/payout/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/payout/tests/__init__.py rename to src/tribler/core/components/payout/__init__.py diff --git a/src/tribler-core/tribler_core/components/payout/payout_component.py b/src/tribler/core/components/payout/payout_component.py similarity index 79% rename from src/tribler-core/tribler_core/components/payout/payout_component.py rename to src/tribler/core/components/payout/payout_component.py index b65240fff66..3ba23f51b0d 100644 --- a/src/tribler-core/tribler_core/components/payout/payout_component.py +++ b/src/tribler/core/components/payout/payout_component.py @@ -1,9 +1,9 @@ -from tribler_core import notifications -from tribler_core.components.bandwidth_accounting.bandwidth_accounting_component import BandwidthAccountingComponent -from tribler_core.components.base import Component -from tribler_core.components.ipv8.ipv8_component import Ipv8Component -from tribler_core.components.payout.payout_manager import PayoutManager -from tribler_core.components.reporter.reporter_component import ReporterComponent +from tribler.core import notifications +from tribler.core.components.bandwidth_accounting.bandwidth_accounting_component import BandwidthAccountingComponent +from tribler.core.components.base import Component +from tribler.core.components.ipv8.ipv8_component import Ipv8Component +from tribler.core.components.payout.payout_manager import PayoutManager +from tribler.core.components.reporter.reporter_component import ReporterComponent INFINITE = -1 diff --git a/src/tribler-core/tribler_core/components/payout/payout_manager.py b/src/tribler/core/components/payout/payout_manager.py similarity index 97% rename from src/tribler-core/tribler_core/components/payout/payout_manager.py rename to src/tribler/core/components/payout/payout_manager.py index e7c30aa2cf7..44cb32ba3e7 100644 --- a/src/tribler-core/tribler_core/components/payout/payout_manager.py +++ b/src/tribler/core/components/payout/payout_manager.py @@ -2,7 +2,7 @@ from ipv8.taskmanager import TaskManager, task -from tribler_core.utilities.unicode import hexlify +from tribler.core.utilities.unicode import hexlify class PayoutManager(TaskManager): diff --git a/src/tribler-core/tribler_core/components/popularity/__init__.py b/src/tribler/core/components/payout/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/popularity/__init__.py rename to src/tribler/core/components/payout/tests/__init__.py diff --git a/src/tribler-core/tribler_core/components/payout/tests/test_payout_component.py b/src/tribler/core/components/payout/tests/test_payout_component.py similarity index 63% rename from src/tribler-core/tribler_core/components/payout/tests/test_payout_component.py rename to src/tribler/core/components/payout/tests/test_payout_component.py index cff2b19e0f2..88ecd65586e 100644 --- a/src/tribler-core/tribler_core/components/payout/tests/test_payout_component.py +++ b/src/tribler/core/components/payout/tests/test_payout_component.py @@ -1,11 +1,11 @@ # pylint: disable=protected-access import pytest -from tribler_core.components.bandwidth_accounting.bandwidth_accounting_component import BandwidthAccountingComponent -from tribler_core.components.base import Session -from tribler_core.components.ipv8.ipv8_component import Ipv8Component -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.payout.payout_component import PayoutComponent +from tribler.core.components.bandwidth_accounting.bandwidth_accounting_component import BandwidthAccountingComponent +from tribler.core.components.base import Session +from tribler.core.components.ipv8.ipv8_component import Ipv8Component +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.payout.payout_component import PayoutComponent @pytest.mark.asyncio diff --git a/src/tribler-core/tribler_core/components/payout/tests/test_payout_manager.py b/src/tribler/core/components/payout/tests/test_payout_manager.py similarity index 97% rename from src/tribler-core/tribler_core/components/payout/tests/test_payout_manager.py rename to src/tribler/core/components/payout/tests/test_payout_manager.py index 84f58716151..2e222c24030 100644 --- a/src/tribler-core/tribler_core/components/payout/tests/test_payout_manager.py +++ b/src/tribler/core/components/payout/tests/test_payout_manager.py @@ -4,7 +4,7 @@ import pytest -from tribler_core.components.payout.payout_manager import PayoutManager +from tribler.core.components.payout.payout_manager import PayoutManager @pytest.fixture diff --git a/src/tribler-core/tribler_core/components/popularity/community/__init__.py b/src/tribler/core/components/popularity/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/popularity/community/__init__.py rename to src/tribler/core/components/popularity/__init__.py diff --git a/src/tribler-core/tribler_core/components/popularity/community/tests/__init__.py b/src/tribler/core/components/popularity/community/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/popularity/community/tests/__init__.py rename to src/tribler/core/components/popularity/community/__init__.py diff --git a/src/tribler-core/tribler_core/components/popularity/community/payload.py b/src/tribler/core/components/popularity/community/payload.py similarity index 100% rename from src/tribler-core/tribler_core/components/popularity/community/payload.py rename to src/tribler/core/components/popularity/community/payload.py diff --git a/src/tribler-core/tribler_core/components/popularity/community/popularity_community.py b/src/tribler/core/components/popularity/community/popularity_community.py similarity index 95% rename from src/tribler-core/tribler_core/components/popularity/community/popularity_community.py rename to src/tribler/core/components/popularity/community/popularity_community.py index fe4a29a0bbc..7c97e5837a9 100644 --- a/src/tribler-core/tribler_core/components/popularity/community/popularity_community.py +++ b/src/tribler/core/components/popularity/community/popularity_community.py @@ -6,10 +6,10 @@ from pony.orm import db_session -from tribler_core.components.metadata_store.remote_query_community.remote_query_community import RemoteQueryCommunity -from tribler_core.components.popularity.community.payload import TorrentsHealthPayload -from tribler_core.components.popularity.community.version_community_mixin import VersionCommunityMixin -from tribler_core.utilities.unicode import hexlify +from tribler.core.components.metadata_store.remote_query_community.remote_query_community import RemoteQueryCommunity +from tribler.core.components.popularity.community.payload import TorrentsHealthPayload +from tribler.core.components.popularity.community.version_community_mixin import VersionCommunityMixin +from tribler.core.utilities.unicode import hexlify class PopularityCommunity(RemoteQueryCommunity, VersionCommunityMixin): diff --git a/src/tribler-core/tribler_core/components/reporter/__init__.py b/src/tribler/core/components/popularity/community/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/reporter/__init__.py rename to src/tribler/core/components/popularity/community/tests/__init__.py diff --git a/src/tribler-core/tribler_core/components/popularity/community/tests/test_popularity_community.py b/src/tribler/core/components/popularity/community/tests/test_popularity_community.py similarity index 96% rename from src/tribler-core/tribler_core/components/popularity/community/tests/test_popularity_community.py rename to src/tribler/core/components/popularity/community/tests/test_popularity_community.py index b35b6036bbe..d431024eb66 100644 --- a/src/tribler-core/tribler_core/components/popularity/community/tests/test_popularity_community.py +++ b/src/tribler/core/components/popularity/community/tests/test_popularity_community.py @@ -12,12 +12,12 @@ import pytest -from tribler_core.components.metadata_store.db.store import MetadataStore -from tribler_core.components.metadata_store.remote_query_community.settings import RemoteQueryCommunitySettings -from tribler_core.components.popularity.community.popularity_community import PopularityCommunity -from tribler_core.tests.tools.base_test import MockObject -from tribler_core.utilities.path_util import Path -from tribler_core.utilities.utilities import random_infohash +from tribler.core.components.metadata_store.db.store import MetadataStore +from tribler.core.components.metadata_store.remote_query_community.settings import RemoteQueryCommunitySettings +from tribler.core.components.popularity.community.popularity_community import PopularityCommunity +from tribler.core.tests.tools.base_test import MockObject +from tribler.core.utilities.path_util import Path +from tribler.core.utilities.utilities import random_infohash class TestPopularityCommunity(TestBase): diff --git a/src/tribler-core/tribler_core/components/popularity/community/tests/test_version_community_mixin.py b/src/tribler/core/components/popularity/community/tests/test_version_community_mixin.py similarity index 95% rename from src/tribler-core/tribler_core/components/popularity/community/tests/test_version_community_mixin.py rename to src/tribler/core/components/popularity/community/tests/test_version_community_mixin.py index e4fe44e6279..74588171304 100644 --- a/src/tribler-core/tribler_core/components/popularity/community/tests/test_version_community_mixin.py +++ b/src/tribler/core/components/popularity/community/tests/test_version_community_mixin.py @@ -6,8 +6,8 @@ from ipv8.messaging.serialization import default_serializer from ipv8.test.base import TestBase from ipv8.test.mocking.ipv8 import MockIPv8 -from tribler_core.components.popularity.community.version_community_mixin import VersionResponse, VersionCommunityMixin -from tribler_core.version import version_id +from tribler.core.components.popularity.community.version_community_mixin import VersionResponse, VersionCommunityMixin +from tribler.core.version import version_id class VersionCommunity(VersionCommunityMixin, Community): diff --git a/src/tribler-core/tribler_core/components/popularity/community/version_community_mixin.py b/src/tribler/core/components/popularity/community/version_community_mixin.py similarity index 98% rename from src/tribler-core/tribler_core/components/popularity/community/version_community_mixin.py rename to src/tribler/core/components/popularity/community/version_community_mixin.py index 80e33a8be51..d87a119cccf 100644 --- a/src/tribler-core/tribler_core/components/popularity/community/version_community_mixin.py +++ b/src/tribler/core/components/popularity/community/version_community_mixin.py @@ -2,7 +2,7 @@ from ipv8.lazy_community import lazy_wrapper from ipv8.messaging.lazy_payload import VariablePayload, vp_compile -from tribler_core.version import version_id +from tribler.core.version import version_id @vp_compile diff --git a/src/tribler-core/tribler_core/components/popularity/popularity_component.py b/src/tribler/core/components/popularity/popularity_component.py similarity index 79% rename from src/tribler-core/tribler_core/components/popularity/popularity_component.py rename to src/tribler/core/components/popularity/popularity_component.py index a780318100b..94854aada12 100644 --- a/src/tribler-core/tribler_core/components/popularity/popularity_component.py +++ b/src/tribler/core/components/popularity/popularity_component.py @@ -1,12 +1,12 @@ from ipv8.peerdiscovery.network import Network -from tribler_core.components.base import Component -from tribler_core.components.gigachannel.community.sync_strategy import RemovePeers -from tribler_core.components.ipv8.ipv8_component import INFINITE, Ipv8Component -from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent -from tribler_core.components.reporter.reporter_component import ReporterComponent -from tribler_core.components.torrent_checker.torrent_checker_component import TorrentCheckerComponent -from tribler_core.components.popularity.community.popularity_community import PopularityCommunity +from tribler.core.components.base import Component +from tribler.core.components.gigachannel.community.sync_strategy import RemovePeers +from tribler.core.components.ipv8.ipv8_component import INFINITE, Ipv8Component +from tribler.core.components.metadata_store.metadata_store_component import MetadataStoreComponent +from tribler.core.components.reporter.reporter_component import ReporterComponent +from tribler.core.components.torrent_checker.torrent_checker_component import TorrentCheckerComponent +from tribler.core.components.popularity.community.popularity_community import PopularityCommunity class PopularityComponent(Component): diff --git a/src/tribler-core/tribler_core/components/popularity/settings.py b/src/tribler/core/components/popularity/settings.py similarity index 67% rename from src/tribler-core/tribler_core/components/popularity/settings.py rename to src/tribler/core/components/popularity/settings.py index 20208883646..8ede6ada29a 100644 --- a/src/tribler-core/tribler_core/components/popularity/settings.py +++ b/src/tribler/core/components/popularity/settings.py @@ -1,4 +1,4 @@ -from tribler_core.config.tribler_config_section import TriblerConfigSection +from tribler.core.config.tribler_config_section import TriblerConfigSection class PopularityCommunitySettings(TriblerConfigSection): diff --git a/src/tribler-core/tribler_core/components/popularity/tests/test_popularity_component.py b/src/tribler/core/components/popularity/tests/test_popularity_component.py similarity index 55% rename from src/tribler-core/tribler_core/components/popularity/tests/test_popularity_component.py rename to src/tribler/core/components/popularity/tests/test_popularity_component.py index 2ee4c77ac7a..e01b169ea45 100644 --- a/src/tribler-core/tribler_core/components/popularity/tests/test_popularity_component.py +++ b/src/tribler/core/components/popularity/tests/test_popularity_component.py @@ -1,14 +1,14 @@ import pytest -from tribler_core.components.base import Session -from tribler_core.components.ipv8.ipv8_component import Ipv8Component -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.libtorrent.libtorrent_component import LibtorrentComponent -from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent -from tribler_core.components.popularity.popularity_component import PopularityComponent -from tribler_core.components.socks_servers.socks_servers_component import SocksServersComponent -from tribler_core.components.tag.tag_component import TagComponent -from tribler_core.components.torrent_checker.torrent_checker_component import TorrentCheckerComponent +from tribler.core.components.base import Session +from tribler.core.components.ipv8.ipv8_component import Ipv8Component +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.libtorrent.libtorrent_component import LibtorrentComponent +from tribler.core.components.metadata_store.metadata_store_component import MetadataStoreComponent +from tribler.core.components.popularity.popularity_component import PopularityComponent +from tribler.core.components.socks_servers.socks_servers_component import SocksServersComponent +from tribler.core.components.tag.tag_component import TagComponent +from tribler.core.components.torrent_checker.torrent_checker_component import TorrentCheckerComponent # pylint: disable=protected-access diff --git a/src/tribler-core/tribler_core/components/resource_monitor/__init__.py b/src/tribler/core/components/reporter/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/resource_monitor/__init__.py rename to src/tribler/core/components/reporter/__init__.py diff --git a/src/tribler-core/tribler_core/components/reporter/exception_handler.py b/src/tribler/core/components/reporter/exception_handler.py similarity index 95% rename from src/tribler-core/tribler_core/components/reporter/exception_handler.py rename to src/tribler/core/components/reporter/exception_handler.py index a87383b0bfd..bc964e74ae8 100644 --- a/src/tribler-core/tribler_core/components/reporter/exception_handler.py +++ b/src/tribler/core/components/reporter/exception_handler.py @@ -7,9 +7,9 @@ from traceback import print_exception from typing import Callable, Optional -from tribler_core.components.base import ComponentStartupException -from tribler_core.components.reporter.reported_error import ReportedError -from tribler_core.sentry_reporter.sentry_reporter import SentryReporter +from tribler.core.components.base import ComponentStartupException +from tribler.core.components.reporter.reported_error import ReportedError +from tribler.core.sentry_reporter.sentry_reporter import SentryReporter # There are some errors that we are ignoring. IGNORED_ERRORS_BY_CODE = { diff --git a/src/tribler-core/tribler_core/components/reporter/reported_error.py b/src/tribler/core/components/reporter/reported_error.py similarity index 100% rename from src/tribler-core/tribler_core/components/reporter/reported_error.py rename to src/tribler/core/components/reporter/reported_error.py diff --git a/src/tribler-core/tribler_core/components/reporter/reporter_component.py b/src/tribler/core/components/reporter/reporter_component.py similarity index 61% rename from src/tribler-core/tribler_core/components/reporter/reporter_component.py rename to src/tribler/core/components/reporter/reporter_component.py index 207706a904c..36f6e29283b 100644 --- a/src/tribler-core/tribler_core/components/reporter/reporter_component.py +++ b/src/tribler/core/components/reporter/reporter_component.py @@ -1,7 +1,7 @@ -from tribler_core.components.base import Component -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.reporter.exception_handler import default_core_exception_handler -from tribler_core.utilities.unicode import hexlify +from tribler.core.components.base import Component +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.reporter.exception_handler import default_core_exception_handler +from tribler.core.utilities.unicode import hexlify class ReporterComponent(Component): diff --git a/src/tribler-core/tribler_core/components/reporter/tests/test_exception_handler.py b/src/tribler/core/components/reporter/tests/test_exception_handler.py similarity index 96% rename from src/tribler-core/tribler_core/components/reporter/tests/test_exception_handler.py rename to src/tribler/core/components/reporter/tests/test_exception_handler.py index f5ce0c79bae..ee981efa582 100644 --- a/src/tribler-core/tribler_core/components/reporter/tests/test_exception_handler.py +++ b/src/tribler/core/components/reporter/tests/test_exception_handler.py @@ -3,9 +3,9 @@ import pytest -from tribler_core.components.reporter.exception_handler import CoreExceptionHandler -from tribler_core.sentry_reporter import sentry_reporter -from tribler_core.sentry_reporter.sentry_reporter import SentryReporter +from tribler.core.components.reporter.exception_handler import CoreExceptionHandler +from tribler.core.sentry_reporter import sentry_reporter +from tribler.core.sentry_reporter.sentry_reporter import SentryReporter # pylint: disable=protected-access, redefined-outer-name # fmt: off diff --git a/src/tribler-core/tribler_core/components/reporter/tests/test_reporter_component.py b/src/tribler/core/components/reporter/tests/test_reporter_component.py similarity index 68% rename from src/tribler-core/tribler_core/components/reporter/tests/test_reporter_component.py rename to src/tribler/core/components/reporter/tests/test_reporter_component.py index 89fe7eb6754..432b24003f0 100644 --- a/src/tribler-core/tribler_core/components/reporter/tests/test_reporter_component.py +++ b/src/tribler/core/components/reporter/tests/test_reporter_component.py @@ -1,8 +1,8 @@ import pytest -from tribler_core.components.base import Session -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.reporter.reporter_component import ReporterComponent +from tribler.core.components.base import Session +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.reporter.reporter_component import ReporterComponent pytestmark = pytest.mark.asyncio diff --git a/src/tribler-core/tribler_core/components/resource_monitor/implementation/__init__.py b/src/tribler/core/components/resource_monitor/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/resource_monitor/implementation/__init__.py rename to src/tribler/core/components/resource_monitor/__init__.py diff --git a/src/tribler-core/tribler_core/components/resource_monitor/implementation/tests/__init__.py b/src/tribler/core/components/resource_monitor/implementation/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/resource_monitor/implementation/tests/__init__.py rename to src/tribler/core/components/resource_monitor/implementation/__init__.py diff --git a/src/tribler-core/tribler_core/components/resource_monitor/implementation/base.py b/src/tribler/core/components/resource_monitor/implementation/base.py similarity index 100% rename from src/tribler-core/tribler_core/components/resource_monitor/implementation/base.py rename to src/tribler/core/components/resource_monitor/implementation/base.py diff --git a/src/tribler-core/tribler_core/components/resource_monitor/implementation/core.py b/src/tribler/core/components/resource_monitor/implementation/core.py similarity index 93% rename from src/tribler-core/tribler_core/components/resource_monitor/implementation/core.py rename to src/tribler/core/components/resource_monitor/implementation/core.py index 96c7afeca30..1b070cdae80 100644 --- a/src/tribler-core/tribler_core/components/resource_monitor/implementation/core.py +++ b/src/tribler/core/components/resource_monitor/implementation/core.py @@ -6,11 +6,11 @@ import psutil -from tribler_core import notifications -from tribler_core.components.resource_monitor.implementation.base import ResourceMonitor -from tribler_core.components.resource_monitor.implementation.profiler import YappiProfiler -from tribler_core.components.resource_monitor.settings import ResourceMonitorSettings -from tribler_core.utilities.notifier import Notifier +from tribler.core import notifications +from tribler.core.components.resource_monitor.implementation.base import ResourceMonitor +from tribler.core.components.resource_monitor.implementation.profiler import YappiProfiler +from tribler.core.components.resource_monitor.settings import ResourceMonitorSettings +from tribler.core.utilities.notifier import Notifier FREE_DISK_THRESHOLD = 100 * (1024 * 1024) # 100MB DEFAULT_RESOURCE_FILENAME = "resources.log" diff --git a/src/tribler-core/tribler_core/components/resource_monitor/implementation/profiler.py b/src/tribler/core/components/resource_monitor/implementation/profiler.py similarity index 100% rename from src/tribler-core/tribler_core/components/resource_monitor/implementation/profiler.py rename to src/tribler/core/components/resource_monitor/implementation/profiler.py diff --git a/src/tribler-core/tribler_core/components/restapi/__init__.py b/src/tribler/core/components/resource_monitor/implementation/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/restapi/__init__.py rename to src/tribler/core/components/resource_monitor/implementation/tests/__init__.py diff --git a/src/tribler-core/tribler_core/components/resource_monitor/implementation/tests/test_resource_monitor.py b/src/tribler/core/components/resource_monitor/implementation/tests/test_resource_monitor.py similarity index 95% rename from src/tribler-core/tribler_core/components/resource_monitor/implementation/tests/test_resource_monitor.py rename to src/tribler/core/components/resource_monitor/implementation/tests/test_resource_monitor.py index 2820e7f8ba7..9b051b9bb9e 100644 --- a/src/tribler-core/tribler_core/components/resource_monitor/implementation/tests/test_resource_monitor.py +++ b/src/tribler/core/components/resource_monitor/implementation/tests/test_resource_monitor.py @@ -6,10 +6,10 @@ import pytest -from tribler_core import notifications -from tribler_core.components.resource_monitor.implementation.core import CoreResourceMonitor -from tribler_core.components.resource_monitor.settings import ResourceMonitorSettings -from tribler_core.utilities.notifier import Notifier +from tribler.core import notifications +from tribler.core.components.resource_monitor.implementation.core import CoreResourceMonitor +from tribler.core.components.resource_monitor.settings import ResourceMonitorSettings +from tribler.core.utilities.notifier import Notifier @pytest.fixture(name="resource_monitor") diff --git a/src/tribler-core/tribler_core/components/resource_monitor/implementation/tests/test_rm_settings.py b/src/tribler/core/components/resource_monitor/implementation/tests/test_rm_settings.py similarity index 89% rename from src/tribler-core/tribler_core/components/resource_monitor/implementation/tests/test_rm_settings.py rename to src/tribler/core/components/resource_monitor/implementation/tests/test_rm_settings.py index 9f76604a333..e4679fa8b0b 100644 --- a/src/tribler-core/tribler_core/components/resource_monitor/implementation/tests/test_rm_settings.py +++ b/src/tribler/core/components/resource_monitor/implementation/tests/test_rm_settings.py @@ -1,6 +1,6 @@ import pytest -from tribler_core.components.resource_monitor.settings import ResourceMonitorSettings +from tribler.core.components.resource_monitor.settings import ResourceMonitorSettings @pytest.mark.asyncio diff --git a/src/tribler-core/tribler_core/components/resource_monitor/resource_monitor_component.py b/src/tribler/core/components/resource_monitor/resource_monitor_component.py similarity index 88% rename from src/tribler-core/tribler_core/components/resource_monitor/resource_monitor_component.py rename to src/tribler/core/components/resource_monitor/resource_monitor_component.py index bd08a1aa224..79afb7fd4da 100644 --- a/src/tribler-core/tribler_core/components/resource_monitor/resource_monitor_component.py +++ b/src/tribler/core/components/resource_monitor/resource_monitor_component.py @@ -1,5 +1,5 @@ -from tribler_core.components.base import Component -from tribler_core.components.resource_monitor.implementation.core import CoreResourceMonitor +from tribler.core.components.base import Component +from tribler.core.components.resource_monitor.implementation.core import CoreResourceMonitor class ResourceMonitorComponent(Component): diff --git a/src/tribler-core/tribler_core/components/resource_monitor/settings.py b/src/tribler/core/components/resource_monitor/settings.py similarity index 89% rename from src/tribler-core/tribler_core/components/resource_monitor/settings.py rename to src/tribler/core/components/resource_monitor/settings.py index 537e03050c3..db7b08c74b8 100644 --- a/src/tribler-core/tribler_core/components/resource_monitor/settings.py +++ b/src/tribler/core/components/resource_monitor/settings.py @@ -1,6 +1,6 @@ from pydantic import validator -from tribler_core.config.tribler_config_section import TriblerConfigSection +from tribler.core.config.tribler_config_section import TriblerConfigSection # pylint: disable=no-self-argument diff --git a/src/tribler-core/tribler_core/components/resource_monitor/tests/test_resource_monitor_component.py b/src/tribler/core/components/resource_monitor/tests/test_resource_monitor_component.py similarity index 71% rename from src/tribler-core/tribler_core/components/resource_monitor/tests/test_resource_monitor_component.py rename to src/tribler/core/components/resource_monitor/tests/test_resource_monitor_component.py index 85f798aa203..1b4e6372f46 100644 --- a/src/tribler-core/tribler_core/components/resource_monitor/tests/test_resource_monitor_component.py +++ b/src/tribler/core/components/resource_monitor/tests/test_resource_monitor_component.py @@ -1,8 +1,8 @@ import pytest -from tribler_core.components.base import Session -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.resource_monitor.resource_monitor_component import ResourceMonitorComponent +from tribler.core.components.base import Session +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.resource_monitor.resource_monitor_component import ResourceMonitorComponent # pylint: disable=protected-access diff --git a/src/tribler-core/tribler_core/components/restapi/rest/tests/__init__.py b/src/tribler/core/components/restapi/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/restapi/rest/tests/__init__.py rename to src/tribler/core/components/restapi/__init__.py diff --git a/src/tribler-core/tribler_core/components/restapi/rest/__init__.py b/src/tribler/core/components/restapi/rest/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/restapi/rest/__init__.py rename to src/tribler/core/components/restapi/rest/__init__.py diff --git a/src/tribler-core/tribler_core/components/restapi/rest/base_api_test.py b/src/tribler/core/components/restapi/rest/base_api_test.py similarity index 94% rename from src/tribler-core/tribler_core/components/restapi/rest/base_api_test.py rename to src/tribler/core/components/restapi/rest/base_api_test.py index 0174076aef2..c347c846706 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/base_api_test.py +++ b/src/tribler/core/components/restapi/rest/base_api_test.py @@ -4,9 +4,9 @@ from aiohttp import ClientSession -from tribler_core.components.restapi.rest import get_param -from tribler_core.utilities.path_util import Path -from tribler_core.version import version_id +from tribler.core.components.restapi.rest import get_param +from tribler.core.utilities.path_util import Path +from tribler.core.version import version_id def path_to_str(obj): diff --git a/src/tribler-core/tribler_core/components/restapi/rest/debug_endpoint.py b/src/tribler/core/components/restapi/rest/debug_endpoint.py similarity index 97% rename from src/tribler-core/tribler_core/components/restapi/rest/debug_endpoint.py rename to src/tribler/core/components/restapi/rest/debug_endpoint.py index 064f033618f..c5dcf4e68a9 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/debug_endpoint.py +++ b/src/tribler/core/components/restapi/rest/debug_endpoint.py @@ -15,11 +15,11 @@ import psutil -from tribler_core.components.resource_monitor.implementation.base import ResourceMonitor -from tribler_core.components.restapi.rest.rest_endpoint import RESTEndpoint, RESTResponse -from tribler_core.utilities.instrumentation import WatchDog -from tribler_core.utilities.osutils import get_root_state_directory -from tribler_core.utilities.path_util import Path +from tribler.core.components.resource_monitor.implementation.base import ResourceMonitor +from tribler.core.components.restapi.rest.rest_endpoint import RESTEndpoint, RESTResponse +from tribler.core.utilities.instrumentation import WatchDog +from tribler.core.utilities.osutils import get_root_state_directory +from tribler.core.utilities.path_util import Path HAS_MELIAE = True try: diff --git a/src/tribler-core/tribler_core/components/restapi/rest/events_endpoint.py b/src/tribler/core/components/restapi/rest/events_endpoint.py similarity index 94% rename from src/tribler-core/tribler_core/components/restapi/rest/events_endpoint.py rename to src/tribler/core/components/restapi/rest/events_endpoint.py index e07ad16aebf..0725d61096d 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/events_endpoint.py +++ b/src/tribler/core/components/restapi/rest/events_endpoint.py @@ -14,13 +14,13 @@ from marshmallow.fields import Dict, String -from tribler_core import notifications -from tribler_core.components.reporter.reported_error import ReportedError -from tribler_core.components.restapi.rest.rest_endpoint import RESTEndpoint, RESTStreamResponse -from tribler_core.components.restapi.rest.util import fix_unicode_dict -from tribler_core.utilities.notifier import Notifier -from tribler_core.utilities.utilities import froze_it -from tribler_core.version import version_id +from tribler.core import notifications +from tribler.core.components.reporter.reported_error import ReportedError +from tribler.core.components.restapi.rest.rest_endpoint import RESTEndpoint, RESTStreamResponse +from tribler.core.components.restapi.rest.util import fix_unicode_dict +from tribler.core.utilities.notifier import Notifier +from tribler.core.utilities.utilities import froze_it +from tribler.core.version import version_id def passthrough(x): diff --git a/src/tribler-core/tribler_core/components/restapi/rest/rest_endpoint.py b/src/tribler/core/components/restapi/rest/rest_endpoint.py similarity index 100% rename from src/tribler-core/tribler_core/components/restapi/rest/rest_endpoint.py rename to src/tribler/core/components/restapi/rest/rest_endpoint.py diff --git a/src/tribler-core/tribler_core/components/restapi/rest/rest_manager.py b/src/tribler/core/components/restapi/rest/rest_manager.py similarity index 94% rename from src/tribler-core/tribler_core/components/restapi/rest/rest_manager.py rename to src/tribler/core/components/restapi/rest/rest_manager.py index a5c99e64421..f3fb668f643 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/rest_manager.py +++ b/src/tribler/core/components/restapi/rest/rest_manager.py @@ -9,16 +9,16 @@ from apispec.core import VALID_METHODS_OPENAPI_V2 -from tribler_core.components.reporter.exception_handler import default_core_exception_handler -from tribler_core.components.restapi.rest.rest_endpoint import ( +from tribler.core.components.reporter.exception_handler import default_core_exception_handler +from tribler.core.components.restapi.rest.rest_endpoint import ( HTTP_INTERNAL_SERVER_ERROR, HTTP_NOT_FOUND, HTTP_UNAUTHORIZED, RESTResponse, ) -from tribler_core.components.restapi.rest.root_endpoint import RootEndpoint -from tribler_core.components.restapi.rest.settings import APISettings -from tribler_core.version import version_id +from tribler.core.components.restapi.rest.root_endpoint import RootEndpoint +from tribler.core.components.restapi.rest.settings import APISettings +from tribler.core.version import version_id logger = logging.getLogger(__name__) diff --git a/src/tribler/core/components/restapi/rest/root_endpoint.py b/src/tribler/core/components/restapi/rest/root_endpoint.py new file mode 100644 index 00000000000..7fd7a40208c --- /dev/null +++ b/src/tribler/core/components/restapi/rest/root_endpoint.py @@ -0,0 +1,7 @@ +from tribler.core.components.restapi.rest.rest_endpoint import RESTEndpoint +from tribler.core.utilities.utilities import froze_it + + +@froze_it +class RootEndpoint(RESTEndpoint): + pass diff --git a/src/tribler-core/tribler_core/components/restapi/rest/schema.py b/src/tribler/core/components/restapi/rest/schema.py similarity index 100% rename from src/tribler-core/tribler_core/components/restapi/rest/schema.py rename to src/tribler/core/components/restapi/rest/schema.py diff --git a/src/tribler-core/tribler_core/components/restapi/rest/settings.py b/src/tribler/core/components/restapi/rest/settings.py similarity index 77% rename from src/tribler-core/tribler_core/components/restapi/rest/settings.py rename to src/tribler/core/components/restapi/rest/settings.py index a211add5175..e5c2044150c 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/settings.py +++ b/src/tribler/core/components/restapi/rest/settings.py @@ -2,8 +2,8 @@ from pydantic import validator -from tribler_core.config.tribler_config_section import TriblerConfigSection -from tribler_core.components.libtorrent.settings import validate_port_with_minus_one +from tribler.core.config.tribler_config_section import TriblerConfigSection +from tribler.core.components.libtorrent.settings import validate_port_with_minus_one class APISettings(TriblerConfigSection): diff --git a/src/tribler-core/tribler_core/components/restapi/rest/settings_endpoint.py b/src/tribler/core/components/restapi/rest/settings_endpoint.py similarity index 90% rename from src/tribler-core/tribler_core/components/restapi/rest/settings_endpoint.py rename to src/tribler/core/components/restapi/rest/settings_endpoint.py index d25c35205a7..e44950163a6 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/settings_endpoint.py +++ b/src/tribler/core/components/restapi/rest/settings_endpoint.py @@ -6,11 +6,11 @@ from marshmallow.fields import Boolean -from tribler_core.components.libtorrent.download_manager.download_manager import DownloadManager -from tribler_core.components.restapi.rest.rest_endpoint import RESTEndpoint, RESTResponse -from tribler_core.config.tribler_config import TriblerConfig -from tribler_core.utilities.network_utils import default_network_utils -from tribler_core.utilities.utilities import froze_it +from tribler.core.components.libtorrent.download_manager.download_manager import DownloadManager +from tribler.core.components.restapi.rest.rest_endpoint import RESTEndpoint, RESTResponse +from tribler.core.config.tribler_config import TriblerConfig +from tribler.core.utilities.network_utils import default_network_utils +from tribler.core.utilities.utilities import froze_it @froze_it diff --git a/src/tribler-core/tribler_core/components/restapi/rest/shutdown_endpoint.py b/src/tribler/core/components/restapi/rest/shutdown_endpoint.py similarity index 88% rename from src/tribler-core/tribler_core/components/restapi/rest/shutdown_endpoint.py rename to src/tribler/core/components/restapi/rest/shutdown_endpoint.py index d58a57c669e..e801a1ec6ed 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/shutdown_endpoint.py +++ b/src/tribler/core/components/restapi/rest/shutdown_endpoint.py @@ -7,8 +7,8 @@ from marshmallow.fields import Boolean -from tribler_core.components.restapi.rest.rest_endpoint import RESTEndpoint, RESTResponse -from tribler_core.utilities.utilities import froze_it +from tribler.core.components.restapi.rest.rest_endpoint import RESTEndpoint, RESTResponse +from tribler.core.utilities.utilities import froze_it @froze_it diff --git a/src/tribler-core/tribler_core/components/restapi/rest/statistics_endpoint.py b/src/tribler/core/components/restapi/rest/statistics_endpoint.py similarity index 94% rename from src/tribler-core/tribler_core/components/restapi/rest/statistics_endpoint.py rename to src/tribler/core/components/restapi/rest/statistics_endpoint.py index 32ff0bd306e..f8eaf0bf25b 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/statistics_endpoint.py +++ b/src/tribler/core/components/restapi/rest/statistics_endpoint.py @@ -7,9 +7,9 @@ from marshmallow.fields import Integer, String -from tribler_core.components.metadata_store.db.store import MetadataStore -from tribler_core.components.restapi.rest.rest_endpoint import RESTEndpoint, RESTResponse -from tribler_core.utilities.utilities import froze_it +from tribler.core.components.metadata_store.db.store import MetadataStore +from tribler.core.components.restapi.rest.rest_endpoint import RESTEndpoint, RESTResponse +from tribler.core.utilities.utilities import froze_it @froze_it diff --git a/src/tribler-core/tribler_core/components/socks_servers/__init__.py b/src/tribler/core/components/restapi/rest/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/socks_servers/__init__.py rename to src/tribler/core/components/restapi/rest/tests/__init__.py diff --git a/src/tribler-core/tribler_core/components/restapi/rest/tests/test_create_torrent_endpoint.py b/src/tribler/core/components/restapi/rest/tests/test_create_torrent_endpoint.py similarity index 90% rename from src/tribler-core/tribler_core/components/restapi/rest/tests/test_create_torrent_endpoint.py rename to src/tribler/core/components/restapi/rest/tests/test_create_torrent_endpoint.py index 0ad61eb2018..ce89ce8e7f3 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/tests/test_create_torrent_endpoint.py +++ b/src/tribler/core/components/restapi/rest/tests/test_create_torrent_endpoint.py @@ -6,11 +6,11 @@ import pytest -from tribler_core.components.libtorrent.restapi.create_torrent_endpoint import CreateTorrentEndpoint -from tribler_core.components.libtorrent.settings import DownloadDefaultsSettings -from tribler_core.components.restapi.rest.base_api_test import do_request -from tribler_core.components.restapi.rest.rest_manager import error_middleware -from tribler_core.tests.tools.common import TESTS_DATA_DIR +from tribler.core.components.libtorrent.restapi.create_torrent_endpoint import CreateTorrentEndpoint +from tribler.core.components.libtorrent.settings import DownloadDefaultsSettings +from tribler.core.components.restapi.rest.base_api_test import do_request +from tribler.core.components.restapi.rest.rest_manager import error_middleware +from tribler.core.tests.tools.common import TESTS_DATA_DIR @pytest.fixture diff --git a/src/tribler-core/tribler_core/components/restapi/rest/tests/test_debug_endpoint.py b/src/tribler/core/components/restapi/rest/tests/test_debug_endpoint.py similarity index 94% rename from src/tribler-core/tribler_core/components/restapi/rest/tests/test_debug_endpoint.py rename to src/tribler/core/components/restapi/rest/tests/test_debug_endpoint.py index c6295dbed0b..442baf081b5 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/tests/test_debug_endpoint.py +++ b/src/tribler/core/components/restapi/rest/tests/test_debug_endpoint.py @@ -6,11 +6,11 @@ import pytest -from tribler_core.components.resource_monitor.implementation.core import CoreResourceMonitor -from tribler_core.components.resource_monitor.settings import ResourceMonitorSettings -from tribler_core.components.restapi.rest.base_api_test import do_request -from tribler_core.components.restapi.rest.debug_endpoint import DebugEndpoint -from tribler_core.components.restapi.rest.rest_manager import error_middleware +from tribler.core.components.resource_monitor.implementation.core import CoreResourceMonitor +from tribler.core.components.resource_monitor.settings import ResourceMonitorSettings +from tribler.core.components.restapi.rest.base_api_test import do_request +from tribler.core.components.restapi.rest.debug_endpoint import DebugEndpoint +from tribler.core.components.restapi.rest.rest_manager import error_middleware @pytest.fixture @@ -163,7 +163,7 @@ async def test_debug_pane_core_logs_in_root_dir(rest_api, tmp_path, endpoint): num_logs = 100 create_dummy_logs(root_state_dir, process=process, num_logs=num_logs) - with patch('tribler_core.components.restapi.rest.debug_endpoint.get_root_state_directory', + with patch('tribler.core.components.restapi.rest.debug_endpoint.get_root_state_directory', new=lambda: root_state_dir): json_response = await do_request(rest_api, f'debug/log?process={process}&max_lines={num_logs}', expected_code=200) logs = json_response['content'].strip().split("\n") @@ -194,7 +194,7 @@ async def test_debug_pane_no_logs(rest_api, endpoint, tmp_path): Test whether the API returns the default response when no log files are found. """ module = 'gui' - with patch('tribler_core.components.restapi.rest.debug_endpoint.get_root_state_directory', + with patch('tribler.core.components.restapi.rest.debug_endpoint.get_root_state_directory', new=lambda: tmp_path / 'nondir'): json_response = await do_request(rest_api, f'debug/log?process={module}&max_lines=', expected_code=200) diff --git a/src/tribler-core/tribler_core/components/restapi/rest/tests/test_events_endpoint.py b/src/tribler/core/components/restapi/rest/tests/test_events_endpoint.py similarity index 92% rename from src/tribler-core/tribler_core/components/restapi/rest/tests/test_events_endpoint.py rename to src/tribler/core/components/restapi/rest/tests/test_events_endpoint.py index 4efcfada49f..be335eaaac1 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/tests/test_events_endpoint.py +++ b/src/tribler/core/components/restapi/rest/tests/test_events_endpoint.py @@ -7,15 +7,15 @@ import pytest -from tribler_core import notifications -from tribler_core.components.reporter.reported_error import ReportedError -from tribler_core.components.restapi.rest.events_endpoint import EventsEndpoint -from tribler_core.components.restapi.rest.rest_endpoint import RESTStreamResponse -from tribler_core.components.restapi.rest.rest_manager import ApiKeyMiddleware, RESTManager, error_middleware -from tribler_core.components.restapi.rest.root_endpoint import RootEndpoint -from tribler_core.config.tribler_config import TriblerConfig -from tribler_core.utilities.notifier import Notifier -from tribler_core.version import version_id +from tribler.core import notifications +from tribler.core.components.reporter.reported_error import ReportedError +from tribler.core.components.restapi.rest.events_endpoint import EventsEndpoint +from tribler.core.components.restapi.rest.rest_endpoint import RESTStreamResponse +from tribler.core.components.restapi.rest.rest_manager import ApiKeyMiddleware, RESTManager, error_middleware +from tribler.core.components.restapi.rest.root_endpoint import RootEndpoint +from tribler.core.config.tribler_config import TriblerConfig +from tribler.core.utilities.notifier import Notifier +from tribler.core.version import version_id messages_to_wait_for = set() diff --git a/src/tribler-core/tribler_core/components/restapi/rest/tests/test_rest_manager.py b/src/tribler/core/components/restapi/rest/tests/test_rest_manager.py similarity index 88% rename from src/tribler-core/tribler_core/components/restapi/rest/tests/test_rest_manager.py rename to src/tribler/core/components/restapi/rest/tests/test_rest_manager.py index f1021254b12..2dedc20be75 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/tests/test_rest_manager.py +++ b/src/tribler/core/components/restapi/rest/tests/test_rest_manager.py @@ -3,13 +3,13 @@ import pytest -from tribler_core.components.restapi.rest.base_api_test import do_real_request -from tribler_core.components.restapi.rest.rest_endpoint import HTTP_UNAUTHORIZED -from tribler_core.components.restapi.rest.rest_manager import ApiKeyMiddleware, RESTManager, error_middleware -from tribler_core.components.restapi.rest.root_endpoint import RootEndpoint -from tribler_core.components.restapi.rest.settings_endpoint import SettingsEndpoint -from tribler_core.config.tribler_config import TriblerConfig -from tribler_core.tests.tools.common import TESTS_DIR +from tribler.core.components.restapi.rest.base_api_test import do_real_request +from tribler.core.components.restapi.rest.rest_endpoint import HTTP_UNAUTHORIZED +from tribler.core.components.restapi.rest.rest_manager import ApiKeyMiddleware, RESTManager, error_middleware +from tribler.core.components.restapi.rest.root_endpoint import RootEndpoint +from tribler.core.components.restapi.rest.settings_endpoint import SettingsEndpoint +from tribler.core.config.tribler_config import TriblerConfig +from tribler.core.tests.tools.common import TESTS_DIR @pytest.fixture() @@ -85,7 +85,7 @@ async def test_unhandled_exception(rest_manager, api_port): Testing whether the API returns a formatted 500 error and calls exception handler if an unhandled Exception is raised """ - with patch('tribler_core.components.restapi.rest.rest_manager.default_core_exception_handler') as handler: + with patch('tribler.core.components.restapi.rest.rest_manager.default_core_exception_handler') as handler: response_dict = await do_real_request(api_port, 'settings', expected_code=500, post_data={'general': 'invalid schema'}, request_type='POST') diff --git a/src/tribler-core/tribler_core/components/restapi/rest/tests/test_settings_endpoint.py b/src/tribler/core/components/restapi/rest/tests/test_settings_endpoint.py similarity index 91% rename from src/tribler-core/tribler_core/components/restapi/rest/tests/test_settings_endpoint.py rename to src/tribler/core/components/restapi/rest/tests/test_settings_endpoint.py index e9ee64102a3..1a23e53f7fb 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/tests/test_settings_endpoint.py +++ b/src/tribler/core/components/restapi/rest/tests/test_settings_endpoint.py @@ -3,12 +3,12 @@ import pytest -from tribler_core.components.libtorrent.download_manager.download_manager import DownloadManager -from tribler_core.components.restapi.rest.base_api_test import do_request -from tribler_core.components.restapi.rest.rest_manager import error_middleware -from tribler_core.components.restapi.rest.settings_endpoint import SettingsEndpoint -from tribler_core.config.tribler_config import TriblerConfig -from tribler_core.utilities.simpledefs import MAX_LIBTORRENT_RATE_LIMIT +from tribler.core.components.libtorrent.download_manager.download_manager import DownloadManager +from tribler.core.components.restapi.rest.base_api_test import do_request +from tribler.core.components.restapi.rest.rest_manager import error_middleware +from tribler.core.components.restapi.rest.settings_endpoint import SettingsEndpoint +from tribler.core.config.tribler_config import TriblerConfig +from tribler.core.utilities.simpledefs import MAX_LIBTORRENT_RATE_LIMIT @pytest.fixture diff --git a/src/tribler-core/tribler_core/components/restapi/rest/tests/test_shutdown_endpoint.py b/src/tribler/core/components/restapi/rest/tests/test_shutdown_endpoint.py similarity index 80% rename from src/tribler-core/tribler_core/components/restapi/rest/tests/test_shutdown_endpoint.py rename to src/tribler/core/components/restapi/rest/tests/test_shutdown_endpoint.py index 4d7d01299df..e96e23460be 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/tests/test_shutdown_endpoint.py +++ b/src/tribler/core/components/restapi/rest/tests/test_shutdown_endpoint.py @@ -4,9 +4,9 @@ import pytest -from tribler_core.components.restapi.rest.base_api_test import do_request -from tribler_core.components.restapi.rest.rest_manager import error_middleware -from tribler_core.components.restapi.rest.shutdown_endpoint import ShutdownEndpoint +from tribler.core.components.restapi.rest.base_api_test import do_request +from tribler.core.components.restapi.rest.rest_manager import error_middleware +from tribler.core.components.restapi.rest.shutdown_endpoint import ShutdownEndpoint @pytest.fixture diff --git a/src/tribler-core/tribler_core/components/restapi/rest/tests/test_statistics_endpoint.py b/src/tribler/core/components/restapi/rest/tests/test_statistics_endpoint.py similarity index 85% rename from src/tribler-core/tribler_core/components/restapi/rest/tests/test_statistics_endpoint.py rename to src/tribler/core/components/restapi/rest/tests/test_statistics_endpoint.py index 3195e99b4df..1281a8cc248 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/tests/test_statistics_endpoint.py +++ b/src/tribler/core/components/restapi/rest/tests/test_statistics_endpoint.py @@ -6,12 +6,12 @@ import pytest -from tribler_core.components.bandwidth_accounting.community.bandwidth_accounting_community \ +from tribler.core.components.bandwidth_accounting.community.bandwidth_accounting_community \ import BandwidthAccountingCommunity -from tribler_core.components.bandwidth_accounting.settings import BandwidthAccountingSettings -from tribler_core.components.restapi.rest.base_api_test import do_request -from tribler_core.components.restapi.rest.rest_manager import error_middleware -from tribler_core.components.restapi.rest.statistics_endpoint import StatisticsEndpoint +from tribler.core.components.bandwidth_accounting.settings import BandwidthAccountingSettings +from tribler.core.components.restapi.rest.base_api_test import do_request +from tribler.core.components.restapi.rest.rest_manager import error_middleware +from tribler.core.components.restapi.rest.statistics_endpoint import StatisticsEndpoint @pytest.fixture diff --git a/src/tribler-core/tribler_core/components/restapi/rest/tests/test_trustview_endpoint.py b/src/tribler/core/components/restapi/rest/tests/test_trustview_endpoint.py similarity index 95% rename from src/tribler-core/tribler_core/components/restapi/rest/tests/test_trustview_endpoint.py rename to src/tribler/core/components/restapi/rest/tests/test_trustview_endpoint.py index eb001728b09..28a9df50c22 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/tests/test_trustview_endpoint.py +++ b/src/tribler/core/components/restapi/rest/tests/test_trustview_endpoint.py @@ -8,14 +8,14 @@ import pytest -from tribler_core.components.bandwidth_accounting.db.database import BandwidthDatabase -from tribler_core.components.bandwidth_accounting.db.transaction import BandwidthTransactionData, EMPTY_SIGNATURE -from tribler_core.components.bandwidth_accounting.trust_calculation.trust_graph import TrustGraph -from tribler_core.components.restapi.rest.base_api_test import do_request -from tribler_core.components.restapi.rest.rest_manager import error_middleware -from tribler_core.components.restapi.rest.trustview_endpoint import TrustViewEndpoint -from tribler_core.exceptions import TrustGraphException -from tribler_core.utilities.utilities import MEMORY_DB +from tribler.core.components.bandwidth_accounting.db.database import BandwidthDatabase +from tribler.core.components.bandwidth_accounting.db.transaction import BandwidthTransactionData, EMPTY_SIGNATURE +from tribler.core.components.bandwidth_accounting.trust_calculation.trust_graph import TrustGraph +from tribler.core.components.restapi.rest.base_api_test import do_request +from tribler.core.components.restapi.rest.rest_manager import error_middleware +from tribler.core.components.restapi.rest.trustview_endpoint import TrustViewEndpoint +from tribler.core.exceptions import TrustGraphException +from tribler.core.utilities.utilities import MEMORY_DB @pytest.fixture diff --git a/src/tribler-core/tribler_core/components/restapi/rest/tests/test_util.py b/src/tribler/core/components/restapi/rest/tests/test_util.py similarity index 95% rename from src/tribler-core/tribler_core/components/restapi/rest/tests/test_util.py rename to src/tribler/core/components/restapi/rest/tests/test_util.py index 8d9de71506c..595039f1bb4 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/tests/test_util.py +++ b/src/tribler/core/components/restapi/rest/tests/test_util.py @@ -1,6 +1,6 @@ from unittest.mock import Mock -from tribler_core.components.restapi.rest.util import fix_unicode_array, fix_unicode_dict, get_parameter +from tribler.core.components.restapi.rest.util import fix_unicode_array, fix_unicode_dict, get_parameter def test_get_parameter(): diff --git a/src/tribler-core/tribler_core/components/restapi/rest/trustview_endpoint.py b/src/tribler/core/components/restapi/rest/trustview_endpoint.py similarity index 88% rename from src/tribler-core/tribler_core/components/restapi/rest/trustview_endpoint.py rename to src/tribler/core/components/restapi/rest/trustview_endpoint.py index c7f2cd5bb42..01d042da36d 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/trustview_endpoint.py +++ b/src/tribler/core/components/restapi/rest/trustview_endpoint.py @@ -8,11 +8,11 @@ from marshmallow.fields import Float, Integer, List, String -from tribler_core.components.bandwidth_accounting.db.database import BandwidthDatabase -from tribler_core.components.bandwidth_accounting.trust_calculation.trust_graph import TrustGraph -from tribler_core.components.restapi.rest.rest_endpoint import RESTEndpoint, RESTResponse -from tribler_core.utilities.unicode import hexlify -from tribler_core.utilities.utilities import froze_it +from tribler.core.components.bandwidth_accounting.db.database import BandwidthDatabase +from tribler.core.components.bandwidth_accounting.trust_calculation.trust_graph import TrustGraph +from tribler.core.components.restapi.rest.rest_endpoint import RESTEndpoint, RESTResponse +from tribler.core.utilities.unicode import hexlify +from tribler.core.utilities.utilities import froze_it @froze_it diff --git a/src/tribler-core/tribler_core/components/restapi/rest/util.py b/src/tribler/core/components/restapi/rest/util.py similarity index 96% rename from src/tribler-core/tribler_core/components/restapi/rest/util.py rename to src/tribler/core/components/restapi/rest/util.py index 41a1a610136..b904c5b31e0 100644 --- a/src/tribler-core/tribler_core/components/restapi/rest/util.py +++ b/src/tribler/core/components/restapi/rest/util.py @@ -1,7 +1,7 @@ """ This file contains some utility methods that are used by the API. """ -from tribler_core.components.restapi.rest.rest_endpoint import HTTP_INTERNAL_SERVER_ERROR, RESTResponse +from tribler.core.components.restapi.rest.rest_endpoint import HTTP_INTERNAL_SERVER_ERROR, RESTResponse def return_handled_exception(request, exception): diff --git a/src/tribler-core/tribler_core/components/restapi/restapi_component.py b/src/tribler/core/components/restapi/restapi_component.py similarity index 76% rename from src/tribler-core/tribler_core/components/restapi/restapi_component.py rename to src/tribler/core/components/restapi/restapi_component.py index 1a5289564b6..9f79f8a9e2f 100644 --- a/src/tribler-core/tribler_core/components/restapi/restapi_component.py +++ b/src/tribler/core/components/restapi/restapi_component.py @@ -3,41 +3,41 @@ from ipv8.REST.root_endpoint import RootEndpoint as IPV8RootEndpoint -from tribler_core.components.bandwidth_accounting.bandwidth_accounting_component import BandwidthAccountingComponent -from tribler_core.components.bandwidth_accounting.restapi.bandwidth_endpoint import BandwidthEndpoint -from tribler_core.components.base import Component, NoneComponent -from tribler_core.components.gigachannel.gigachannel_component import GigaChannelComponent -from tribler_core.components.gigachannel_manager.gigachannel_manager_component import GigachannelManagerComponent -from tribler_core.components.ipv8.ipv8_component import Ipv8Component -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.libtorrent.libtorrent_component import LibtorrentComponent -from tribler_core.components.libtorrent.restapi.create_torrent_endpoint import CreateTorrentEndpoint -from tribler_core.components.libtorrent.restapi.downloads_endpoint import DownloadsEndpoint -from tribler_core.components.libtorrent.restapi.libtorrent_endpoint import LibTorrentEndpoint -from tribler_core.components.libtorrent.restapi.torrentinfo_endpoint import TorrentInfoEndpoint -from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent -from tribler_core.components.metadata_store.restapi.channels_endpoint import ChannelsEndpoint -from tribler_core.components.metadata_store.restapi.metadata_endpoint import MetadataEndpoint -from tribler_core.components.metadata_store.restapi.remote_query_endpoint import RemoteQueryEndpoint -from tribler_core.components.metadata_store.restapi.search_endpoint import SearchEndpoint -from tribler_core.components.reporter.exception_handler import CoreExceptionHandler, default_core_exception_handler -from tribler_core.components.reporter.reported_error import ReportedError -from tribler_core.components.reporter.reporter_component import ReporterComponent -from tribler_core.components.resource_monitor.resource_monitor_component import ResourceMonitorComponent -from tribler_core.components.restapi.rest.debug_endpoint import DebugEndpoint -from tribler_core.components.restapi.rest.events_endpoint import EventsEndpoint -from tribler_core.components.restapi.rest.rest_endpoint import RESTEndpoint -from tribler_core.components.restapi.rest.rest_manager import ApiKeyMiddleware, RESTManager, error_middleware -from tribler_core.components.restapi.rest.root_endpoint import RootEndpoint -from tribler_core.components.restapi.rest.settings_endpoint import SettingsEndpoint -from tribler_core.components.restapi.rest.shutdown_endpoint import ShutdownEndpoint -from tribler_core.components.restapi.rest.statistics_endpoint import StatisticsEndpoint -from tribler_core.components.restapi.rest.trustview_endpoint import TrustViewEndpoint -from tribler_core.components.tag.restapi.tags_endpoint import TagsEndpoint -from tribler_core.components.tag.tag_component import TagComponent -from tribler_core.components.torrent_checker.torrent_checker_component import TorrentCheckerComponent -from tribler_core.components.tunnel.tunnel_component import TunnelsComponent -from tribler_core.utilities.unicode import hexlify +from tribler.core.components.bandwidth_accounting.bandwidth_accounting_component import BandwidthAccountingComponent +from tribler.core.components.bandwidth_accounting.restapi.bandwidth_endpoint import BandwidthEndpoint +from tribler.core.components.base import Component, NoneComponent +from tribler.core.components.gigachannel.gigachannel_component import GigaChannelComponent +from tribler.core.components.gigachannel_manager.gigachannel_manager_component import GigachannelManagerComponent +from tribler.core.components.ipv8.ipv8_component import Ipv8Component +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.libtorrent.libtorrent_component import LibtorrentComponent +from tribler.core.components.libtorrent.restapi.create_torrent_endpoint import CreateTorrentEndpoint +from tribler.core.components.libtorrent.restapi.downloads_endpoint import DownloadsEndpoint +from tribler.core.components.libtorrent.restapi.libtorrent_endpoint import LibTorrentEndpoint +from tribler.core.components.libtorrent.restapi.torrentinfo_endpoint import TorrentInfoEndpoint +from tribler.core.components.metadata_store.metadata_store_component import MetadataStoreComponent +from tribler.core.components.metadata_store.restapi.channels_endpoint import ChannelsEndpoint +from tribler.core.components.metadata_store.restapi.metadata_endpoint import MetadataEndpoint +from tribler.core.components.metadata_store.restapi.remote_query_endpoint import RemoteQueryEndpoint +from tribler.core.components.metadata_store.restapi.search_endpoint import SearchEndpoint +from tribler.core.components.reporter.exception_handler import CoreExceptionHandler, default_core_exception_handler +from tribler.core.components.reporter.reported_error import ReportedError +from tribler.core.components.reporter.reporter_component import ReporterComponent +from tribler.core.components.resource_monitor.resource_monitor_component import ResourceMonitorComponent +from tribler.core.components.restapi.rest.debug_endpoint import DebugEndpoint +from tribler.core.components.restapi.rest.events_endpoint import EventsEndpoint +from tribler.core.components.restapi.rest.rest_endpoint import RESTEndpoint +from tribler.core.components.restapi.rest.rest_manager import ApiKeyMiddleware, RESTManager, error_middleware +from tribler.core.components.restapi.rest.root_endpoint import RootEndpoint +from tribler.core.components.restapi.rest.settings_endpoint import SettingsEndpoint +from tribler.core.components.restapi.rest.shutdown_endpoint import ShutdownEndpoint +from tribler.core.components.restapi.rest.statistics_endpoint import StatisticsEndpoint +from tribler.core.components.restapi.rest.trustview_endpoint import TrustViewEndpoint +from tribler.core.components.tag.restapi.tags_endpoint import TagsEndpoint +from tribler.core.components.tag.tag_component import TagComponent +from tribler.core.components.torrent_checker.torrent_checker_component import TorrentCheckerComponent +from tribler.core.components.tunnel.tunnel_component import TunnelsComponent +from tribler.core.utilities.unicode import hexlify class RESTComponent(Component): diff --git a/src/tribler-core/tribler_core/components/restapi/tests/test_restapi_component.py b/src/tribler/core/components/restapi/tests/test_restapi_component.py similarity index 78% rename from src/tribler-core/tribler_core/components/restapi/tests/test_restapi_component.py rename to src/tribler/core/components/restapi/tests/test_restapi_component.py index 97b72281142..dc2ee783748 100644 --- a/src/tribler-core/tribler_core/components/restapi/tests/test_restapi_component.py +++ b/src/tribler/core/components/restapi/tests/test_restapi_component.py @@ -2,19 +2,19 @@ import pytest -from tribler_core.components.bandwidth_accounting.bandwidth_accounting_component import BandwidthAccountingComponent -from tribler_core.components.base import NoneComponent, Session -from tribler_core.components.gigachannel.gigachannel_component import GigaChannelComponent -from tribler_core.components.ipv8.ipv8_component import Ipv8Component -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.libtorrent.libtorrent_component import LibtorrentComponent -from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent -from tribler_core.components.reporter.reported_error import ReportedError -from tribler_core.components.resource_monitor.resource_monitor_component import ResourceMonitorComponent -from tribler_core.components.restapi.rest.rest_endpoint import RESTEndpoint -from tribler_core.components.restapi.restapi_component import RESTComponent -from tribler_core.components.socks_servers.socks_servers_component import SocksServersComponent -from tribler_core.components.tag.tag_component import TagComponent +from tribler.core.components.bandwidth_accounting.bandwidth_accounting_component import BandwidthAccountingComponent +from tribler.core.components.base import NoneComponent, Session +from tribler.core.components.gigachannel.gigachannel_component import GigaChannelComponent +from tribler.core.components.ipv8.ipv8_component import Ipv8Component +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.libtorrent.libtorrent_component import LibtorrentComponent +from tribler.core.components.metadata_store.metadata_store_component import MetadataStoreComponent +from tribler.core.components.reporter.reported_error import ReportedError +from tribler.core.components.resource_monitor.resource_monitor_component import ResourceMonitorComponent +from tribler.core.components.restapi.rest.rest_endpoint import RESTEndpoint +from tribler.core.components.restapi.restapi_component import RESTComponent +from tribler.core.components.socks_servers.socks_servers_component import SocksServersComponent +from tribler.core.components.tag.tag_component import TagComponent # pylint: disable=protected-access, not-callable, redefined-outer-name diff --git a/src/tribler-core/tribler_core/components/socks_servers/socks5/tests/__init__.py b/src/tribler/core/components/socks_servers/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/socks_servers/socks5/tests/__init__.py rename to src/tribler/core/components/socks_servers/__init__.py diff --git a/src/tribler-core/tribler_core/components/socks_servers/socks5/__init__.py b/src/tribler/core/components/socks_servers/socks5/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/socks_servers/socks5/__init__.py rename to src/tribler/core/components/socks_servers/socks5/__init__.py diff --git a/src/tribler-core/tribler_core/components/socks_servers/socks5/aiohttp_connector.py b/src/tribler/core/components/socks_servers/socks5/aiohttp_connector.py similarity index 95% rename from src/tribler-core/tribler_core/components/socks_servers/socks5/aiohttp_connector.py rename to src/tribler/core/components/socks_servers/socks5/aiohttp_connector.py index 6db121e32e1..5ea855f5dcf 100644 --- a/src/tribler-core/tribler_core/components/socks_servers/socks5/aiohttp_connector.py +++ b/src/tribler/core/components/socks_servers/socks5/aiohttp_connector.py @@ -4,7 +4,7 @@ from aiohttp import TCPConnector from aiohttp.abc import AbstractResolver -from tribler_core.components.socks_servers.socks5.client import Socks5Client +from tribler.core.components.socks_servers.socks5.client import Socks5Client class FakeResolver(AbstractResolver): diff --git a/src/tribler-core/tribler_core/components/socks_servers/socks5/client.py b/src/tribler/core/components/socks_servers/socks5/client.py similarity index 98% rename from src/tribler-core/tribler_core/components/socks_servers/socks5/client.py rename to src/tribler/core/components/socks_servers/socks5/client.py index 92d6a707e0a..f3a8b159ad5 100644 --- a/src/tribler-core/tribler_core/components/socks_servers/socks5/client.py +++ b/src/tribler/core/components/socks_servers/socks5/client.py @@ -6,7 +6,7 @@ from ipv8.messaging.interfaces.udp.endpoint import DomainAddress from ipv8.messaging.serialization import PackError -from tribler_core.components.socks_servers.socks5.conversion import ( +from tribler.core.components.socks_servers.socks5.conversion import ( CommandRequest, CommandResponse, MethodsRequest, diff --git a/src/tribler-core/tribler_core/components/socks_servers/socks5/connection.py b/src/tribler/core/components/socks_servers/socks5/connection.py similarity index 98% rename from src/tribler-core/tribler_core/components/socks_servers/socks5/connection.py rename to src/tribler/core/components/socks_servers/socks5/connection.py index dabfdf60612..6eb34282db3 100644 --- a/src/tribler-core/tribler_core/components/socks_servers/socks5/connection.py +++ b/src/tribler/core/components/socks_servers/socks5/connection.py @@ -3,7 +3,7 @@ from ipv8.messaging.serialization import PackError -from tribler_core.components.socks_servers.socks5.conversion import ( +from tribler.core.components.socks_servers.socks5.conversion import ( CommandRequest, CommandResponse, MethodsRequest, @@ -16,7 +16,7 @@ SOCKS_VERSION, socks5_serializer, ) -from tribler_core.components.socks_servers.socks5.udp_connection import SocksUDPConnection +from tribler.core.components.socks_servers.socks5.udp_connection import SocksUDPConnection class ConnectionState: diff --git a/src/tribler-core/tribler_core/components/socks_servers/socks5/conversion.py b/src/tribler/core/components/socks_servers/socks5/conversion.py similarity index 100% rename from src/tribler-core/tribler_core/components/socks_servers/socks5/conversion.py rename to src/tribler/core/components/socks_servers/socks5/conversion.py diff --git a/src/tribler-core/tribler_core/components/socks_servers/socks5/server.py b/src/tribler/core/components/socks_servers/socks5/server.py similarity index 92% rename from src/tribler-core/tribler_core/components/socks_servers/socks5/server.py rename to src/tribler/core/components/socks_servers/socks5/server.py index 0d828b08c90..27153e94961 100644 --- a/src/tribler-core/tribler_core/components/socks_servers/socks5/server.py +++ b/src/tribler/core/components/socks_servers/socks5/server.py @@ -2,8 +2,8 @@ from asyncio import get_event_loop from typing import Optional -from tribler_core.components.socks_servers.socks5.connection import Socks5Connection -from tribler_core.components.tunnel.community.dispatcher import TunnelDispatcher +from tribler.core.components.socks_servers.socks5.connection import Socks5Connection +from tribler.core.components.tunnel.community.dispatcher import TunnelDispatcher class Socks5Server: diff --git a/src/tribler-core/tribler_core/components/tag/__init__.py b/src/tribler/core/components/socks_servers/socks5/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/tag/__init__.py rename to src/tribler/core/components/socks_servers/socks5/tests/__init__.py diff --git a/src/tribler-core/tribler_core/components/socks_servers/socks5/tests/test_connection.py b/src/tribler/core/components/socks_servers/socks5/tests/test_connection.py similarity index 96% rename from src/tribler-core/tribler_core/components/socks_servers/socks5/tests/test_connection.py rename to src/tribler/core/components/socks_servers/socks5/tests/test_connection.py index 07a5569950e..a7814486295 100644 --- a/src/tribler-core/tribler_core/components/socks_servers/socks5/tests/test_connection.py +++ b/src/tribler/core/components/socks_servers/socks5/tests/test_connection.py @@ -4,8 +4,8 @@ import pytest -from tribler_core.components.socks_servers.socks5.connection import ConnectionState, Socks5Connection -from tribler_core.tests.tools.base_test import MockObject +from tribler.core.components.socks_servers.socks5.connection import ConnectionState, Socks5Connection +from tribler.core.tests.tools.base_test import MockObject class MockTransport(MockObject): diff --git a/src/tribler-core/tribler_core/components/socks_servers/socks5/tests/test_conversion.py b/src/tribler/core/components/socks_servers/socks5/tests/test_conversion.py similarity index 97% rename from src/tribler-core/tribler_core/components/socks_servers/socks5/tests/test_conversion.py rename to src/tribler/core/components/socks_servers/socks5/tests/test_conversion.py index f560d5a8607..2a00d26284b 100644 --- a/src/tribler-core/tribler_core/components/socks_servers/socks5/tests/test_conversion.py +++ b/src/tribler/core/components/socks_servers/socks5/tests/test_conversion.py @@ -5,7 +5,7 @@ import pytest -from tribler_core.components.socks_servers.socks5.conversion import ( +from tribler.core.components.socks_servers.socks5.conversion import ( CommandRequest, CommandResponse, UdpPacket, diff --git a/src/tribler-core/tribler_core/components/socks_servers/socks5/tests/test_server.py b/src/tribler/core/components/socks_servers/socks5/tests/test_server.py similarity index 93% rename from src/tribler-core/tribler_core/components/socks_servers/socks5/tests/test_server.py rename to src/tribler/core/components/socks_servers/socks5/tests/test_server.py index ff3c1c9ef59..0c258ee3d14 100644 --- a/src/tribler-core/tribler_core/components/socks_servers/socks5/tests/test_server.py +++ b/src/tribler/core/components/socks_servers/socks5/tests/test_server.py @@ -5,10 +5,10 @@ import pytest -from tribler_core.components.socks_servers.socks5.aiohttp_connector import Socks5Connector -from tribler_core.components.socks_servers.socks5.client import Socks5Client, Socks5Error -from tribler_core.components.socks_servers.socks5.conversion import UdpPacket, socks5_serializer -from tribler_core.components.socks_servers.socks5.server import Socks5Server +from tribler.core.components.socks_servers.socks5.aiohttp_connector import Socks5Connector +from tribler.core.components.socks_servers.socks5.client import Socks5Client, Socks5Error +from tribler.core.components.socks_servers.socks5.conversion import UdpPacket, socks5_serializer +from tribler.core.components.socks_servers.socks5.server import Socks5Server @pytest.fixture(name='socks5_server') diff --git a/src/tribler-core/tribler_core/components/socks_servers/socks5/tests/test_udp_connection.py b/src/tribler/core/components/socks_servers/socks5/tests/test_udp_connection.py similarity index 94% rename from src/tribler-core/tribler_core/components/socks_servers/socks5/tests/test_udp_connection.py rename to src/tribler/core/components/socks_servers/socks5/tests/test_udp_connection.py index d14372fda7d..015ffd0d660 100644 --- a/src/tribler-core/tribler_core/components/socks_servers/socks5/tests/test_udp_connection.py +++ b/src/tribler/core/components/socks_servers/socks5/tests/test_udp_connection.py @@ -1,6 +1,6 @@ import pytest -from tribler_core.components.socks_servers.socks5.udp_connection import SocksUDPConnection +from tribler.core.components.socks_servers.socks5.udp_connection import SocksUDPConnection @pytest.fixture diff --git a/src/tribler-core/tribler_core/components/socks_servers/socks5/udp_connection.py b/src/tribler/core/components/socks_servers/socks5/udp_connection.py similarity index 97% rename from src/tribler-core/tribler_core/components/socks_servers/socks5/udp_connection.py rename to src/tribler/core/components/socks_servers/socks5/udp_connection.py index af58d8a0ee1..3fa6a63225c 100644 --- a/src/tribler-core/tribler_core/components/socks_servers/socks5/udp_connection.py +++ b/src/tribler/core/components/socks_servers/socks5/udp_connection.py @@ -3,7 +3,7 @@ from ipv8.messaging.serialization import PackError -from tribler_core.components.socks_servers.socks5.conversion import UdpPacket, socks5_serializer +from tribler.core.components.socks_servers.socks5.conversion import UdpPacket, socks5_serializer class SocksUDPConnection(DatagramProtocol): diff --git a/src/tribler-core/tribler_core/components/socks_servers/socks_servers_component.py b/src/tribler/core/components/socks_servers/socks_servers_component.py similarity index 81% rename from src/tribler-core/tribler_core/components/socks_servers/socks_servers_component.py rename to src/tribler/core/components/socks_servers/socks_servers_component.py index 0fc1562f134..cfa65086914 100644 --- a/src/tribler-core/tribler_core/components/socks_servers/socks_servers_component.py +++ b/src/tribler/core/components/socks_servers/socks_servers_component.py @@ -1,9 +1,9 @@ from typing import List -from tribler_core.components.base import Component -from tribler_core.components.reporter.reporter_component import ReporterComponent -from tribler_core.components.socks_servers.socks5.server import Socks5Server -from tribler_core.utilities.network_utils import default_network_utils +from tribler.core.components.base import Component +from tribler.core.components.reporter.reporter_component import ReporterComponent +from tribler.core.components.socks_servers.socks5.server import Socks5Server +from tribler.core.utilities.network_utils import default_network_utils NUM_SOCKS_PROXIES = 5 diff --git a/src/tribler-core/tribler_core/components/socks_servers/tests/test_socks_servers_component.py b/src/tribler/core/components/socks_servers/tests/test_socks_servers_component.py similarity index 80% rename from src/tribler-core/tribler_core/components/socks_servers/tests/test_socks_servers_component.py rename to src/tribler/core/components/socks_servers/tests/test_socks_servers_component.py index 6e59cfedcdd..a88886037a0 100644 --- a/src/tribler-core/tribler_core/components/socks_servers/tests/test_socks_servers_component.py +++ b/src/tribler/core/components/socks_servers/tests/test_socks_servers_component.py @@ -1,7 +1,7 @@ import pytest -from tribler_core.components.base import Session -from tribler_core.components.socks_servers.socks_servers_component import SocksServersComponent +from tribler.core.components.base import Session +from tribler.core.components.socks_servers.socks_servers_component import SocksServersComponent # pylint: disable=protected-access diff --git a/src/tribler-core/tribler_core/components/tag/community/__init__.py b/src/tribler/core/components/tag/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/tag/community/__init__.py rename to src/tribler/core/components/tag/__init__.py diff --git a/src/tribler-core/tribler_core/components/tag/community/tests/__init__.py b/src/tribler/core/components/tag/community/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/tag/community/tests/__init__.py rename to src/tribler/core/components/tag/community/__init__.py diff --git a/src/tribler-core/tribler_core/components/tag/community/tag_community.py b/src/tribler/core/components/tag/community/tag_community.py similarity index 94% rename from src/tribler-core/tribler_core/components/tag/community/tag_community.py rename to src/tribler/core/components/tag/community/tag_community.py index 46f32672cc0..ca3cd192d30 100644 --- a/src/tribler-core/tribler_core/components/tag/community/tag_community.py +++ b/src/tribler/core/components/tag/community/tag_community.py @@ -9,17 +9,17 @@ from pony.orm import db_session -from tribler_core.components.ipv8.tribler_community import TriblerCommunity -from tribler_core.components.tag.community.tag_payload import ( +from tribler.core.components.ipv8.tribler_community import TriblerCommunity +from tribler.core.components.tag.community.tag_payload import ( RawTagOperationMessage, RequestTagOperationMessage, TagOperation, TagOperationMessage, TagOperationSignature, ) -from tribler_core.components.tag.community.tag_requests import PeerValidationError, TagRequests -from tribler_core.components.tag.community.tag_validator import validate_operation, validate_tag -from tribler_core.components.tag.db.tag_db import TagDatabase +from tribler.core.components.tag.community.tag_requests import PeerValidationError, TagRequests +from tribler.core.components.tag.community.tag_validator import validate_operation, validate_tag +from tribler.core.components.tag.db.tag_db import TagDatabase REQUESTED_TAGS_COUNT = 10 diff --git a/src/tribler-core/tribler_core/components/tag/community/tag_payload.py b/src/tribler/core/components/tag/community/tag_payload.py similarity index 100% rename from src/tribler-core/tribler_core/components/tag/community/tag_payload.py rename to src/tribler/core/components/tag/community/tag_payload.py diff --git a/src/tribler-core/tribler_core/components/tag/community/tag_requests.py b/src/tribler/core/components/tag/community/tag_requests.py similarity index 100% rename from src/tribler-core/tribler_core/components/tag/community/tag_requests.py rename to src/tribler/core/components/tag/community/tag_requests.py diff --git a/src/tribler-core/tribler_core/components/tag/community/tag_validator.py b/src/tribler/core/components/tag/community/tag_validator.py similarity index 82% rename from src/tribler-core/tribler_core/components/tag/community/tag_validator.py rename to src/tribler/core/components/tag/community/tag_validator.py index 4bd49bf05bb..63af27ecbbb 100644 --- a/src/tribler-core/tribler_core/components/tag/community/tag_validator.py +++ b/src/tribler/core/components/tag/community/tag_validator.py @@ -1,5 +1,5 @@ -from tribler_core.components.tag.community.tag_payload import TagOperationEnum -from tribler_core.components.tag.tag_constants import MAX_TAG_LENGTH, MIN_TAG_LENGTH +from tribler.core.components.tag.community.tag_payload import TagOperationEnum +from tribler.core.components.tag.tag_constants import MAX_TAG_LENGTH, MIN_TAG_LENGTH def validate_tag(tag: str): diff --git a/src/tribler-core/tribler_core/components/torrent_checker/__init__.py b/src/tribler/core/components/tag/community/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/torrent_checker/__init__.py rename to src/tribler/core/components/tag/community/tests/__init__.py diff --git a/src/tribler-core/tribler_core/components/tag/community/tests/test_tag_community.py b/src/tribler/core/components/tag/community/tests/test_tag_community.py similarity index 95% rename from src/tribler-core/tribler_core/components/tag/community/tests/test_tag_community.py rename to src/tribler/core/components/tag/community/tests/test_tag_community.py index ac35da8cfdb..0141dddd180 100644 --- a/src/tribler-core/tribler_core/components/tag/community/tests/test_tag_community.py +++ b/src/tribler/core/components/tag/community/tests/test_tag_community.py @@ -9,10 +9,10 @@ from pony.orm import db_session -from tribler_core.components.tag.community.tag_community import TagCommunity -from tribler_core.components.tag.community.tag_payload import TagOperation -from tribler_core.components.tag.community.tag_requests import PeerValidationError -from tribler_core.components.tag.db.tag_db import TagDatabase, TagOperationEnum +from tribler.core.components.tag.community.tag_community import TagCommunity +from tribler.core.components.tag.community.tag_payload import TagOperation +from tribler.core.components.tag.community.tag_requests import PeerValidationError +from tribler.core.components.tag.db.tag_db import TagDatabase, TagOperationEnum REQUEST_INTERVAL_FOR_RANDOM_TAGS = 0.1 # in seconds diff --git a/src/tribler-core/tribler_core/components/tag/community/tests/test_tag_requests.py b/src/tribler/core/components/tag/community/tests/test_tag_requests.py similarity index 94% rename from src/tribler-core/tribler_core/components/tag/community/tests/test_tag_requests.py rename to src/tribler/core/components/tag/community/tests/test_tag_requests.py index 3082822b6d1..0e5d2c3db03 100644 --- a/src/tribler-core/tribler_core/components/tag/community/tests/test_tag_requests.py +++ b/src/tribler/core/components/tag/community/tests/test_tag_requests.py @@ -1,6 +1,6 @@ import pytest -from tribler_core.components.tag.community.tag_requests import TagRequests +from tribler.core.components.tag.community.tag_requests import TagRequests # pylint: disable=protected-access, redefined-outer-name diff --git a/src/tribler-core/tribler_core/components/tag/community/tests/test_tag_validator.py b/src/tribler/core/components/tag/community/tests/test_tag_validator.py similarity index 90% rename from src/tribler-core/tribler_core/components/tag/community/tests/test_tag_validator.py rename to src/tribler/core/components/tag/community/tests/test_tag_validator.py index a80c4945637..a7d49247db8 100644 --- a/src/tribler-core/tribler_core/components/tag/community/tests/test_tag_validator.py +++ b/src/tribler/core/components/tag/community/tests/test_tag_validator.py @@ -1,7 +1,7 @@ import pytest -from tribler_core.components.tag.community.tag_payload import TagOperationEnum -from tribler_core.components.tag.community.tag_validator import is_valid_tag, validate_operation, validate_tag +from tribler.core.components.tag.community.tag_payload import TagOperationEnum +from tribler.core.components.tag.community.tag_validator import is_valid_tag, validate_operation, validate_tag pytestmark = pytest.mark.asyncio diff --git a/src/tribler-core/tribler_core/components/tag/db/tag_db.py b/src/tribler/core/components/tag/db/tag_db.py similarity index 98% rename from src/tribler-core/tribler_core/components/tag/db/tag_db.py rename to src/tribler/core/components/tag/db/tag_db.py index be7f58cd247..53daa6548d7 100644 --- a/src/tribler-core/tribler_core/components/tag/db/tag_db.py +++ b/src/tribler/core/components/tag/db/tag_db.py @@ -6,9 +6,9 @@ from pony.orm import exists, select from pony.utils import between -from tribler_core.components.tag.community.tag_payload import TagOperation, TagOperationEnum -from tribler_core.utilities.pony_utils import get_or_create -from tribler_core.utilities.unicode import hexlify +from tribler.core.components.tag.community.tag_payload import TagOperation, TagOperationEnum +from tribler.core.utilities.pony_utils import get_or_create +from tribler.core.utilities.unicode import hexlify CLOCK_START_VALUE = 0 diff --git a/src/tribler-core/tribler_core/components/tag/db/tests/test_tag_db.py b/src/tribler/core/components/tag/db/tests/test_tag_db.py similarity index 98% rename from src/tribler-core/tribler_core/components/tag/db/tests/test_tag_db.py rename to src/tribler/core/components/tag/db/tests/test_tag_db.py index 439b6324fb0..1664fd87aac 100644 --- a/src/tribler-core/tribler_core/components/tag/db/tests/test_tag_db.py +++ b/src/tribler/core/components/tag/db/tests/test_tag_db.py @@ -10,9 +10,9 @@ from pony.orm import commit, db_session # pylint: disable=protected-access -from tribler_core.components.tag.community.tag_payload import TagOperation, TagOperationEnum -from tribler_core.components.tag.db.tag_db import PUBLIC_KEY_FOR_AUTO_GENERATED_TAGS, SHOW_THRESHOLD, TagDatabase -from tribler_core.utilities.pony_utils import get_or_create +from tribler.core.components.tag.community.tag_payload import TagOperation, TagOperationEnum +from tribler.core.components.tag.db.tag_db import PUBLIC_KEY_FOR_AUTO_GENERATED_TAGS, SHOW_THRESHOLD, TagDatabase +from tribler.core.utilities.pony_utils import get_or_create @dataclass diff --git a/src/tribler-core/tribler_core/components/tag/restapi/tags_endpoint.py b/src/tribler/core/components/tag/restapi/tags_endpoint.py similarity index 91% rename from src/tribler-core/tribler_core/components/tag/restapi/tags_endpoint.py rename to src/tribler/core/components/tag/restapi/tags_endpoint.py index 52a06b7717b..2415cd11d07 100644 --- a/src/tribler-core/tribler_core/components/tag/restapi/tags_endpoint.py +++ b/src/tribler/core/components/tag/restapi/tags_endpoint.py @@ -12,13 +12,13 @@ from pony.orm import db_session -from tribler_core.components.restapi.rest.rest_endpoint import HTTP_BAD_REQUEST, RESTEndpoint, RESTResponse -from tribler_core.components.restapi.rest.schema import HandledErrorSchema -from tribler_core.components.tag.community.tag_community import TagCommunity -from tribler_core.components.tag.community.tag_payload import TagOperation -from tribler_core.components.tag.db.tag_db import TagDatabase, TagOperationEnum -from tribler_core.components.tag.tag_constants import MAX_TAG_LENGTH, MIN_TAG_LENGTH -from tribler_core.utilities.utilities import froze_it +from tribler.core.components.restapi.rest.rest_endpoint import HTTP_BAD_REQUEST, RESTEndpoint, RESTResponse +from tribler.core.components.restapi.rest.schema import HandledErrorSchema +from tribler.core.components.tag.community.tag_community import TagCommunity +from tribler.core.components.tag.community.tag_payload import TagOperation +from tribler.core.components.tag.db.tag_db import TagDatabase, TagOperationEnum +from tribler.core.components.tag.tag_constants import MAX_TAG_LENGTH, MIN_TAG_LENGTH +from tribler.core.utilities.utilities import froze_it @froze_it diff --git a/src/tribler-core/tribler_core/components/tag/restapi/tests/test_tags_endpoint.py b/src/tribler/core/components/tag/restapi/tests/test_tags_endpoint.py similarity index 93% rename from src/tribler-core/tribler_core/components/tag/restapi/tests/test_tags_endpoint.py rename to src/tribler/core/components/tag/restapi/tests/test_tags_endpoint.py index 1f41418a4c1..86ef1c44855 100644 --- a/src/tribler-core/tribler_core/components/tag/restapi/tests/test_tags_endpoint.py +++ b/src/tribler/core/components/tag/restapi/tests/test_tags_endpoint.py @@ -10,11 +10,11 @@ import pytest -from tribler_core.components.restapi.rest.base_api_test import do_request -from tribler_core.components.tag.community.tag_payload import TagOperation, TagOperationEnum -from tribler_core.components.tag.restapi.tags_endpoint import TagsEndpoint -from tribler_core.conftest import TEST_PERSONAL_KEY -from tribler_core.utilities.unicode import hexlify +from tribler.core.components.restapi.rest.base_api_test import do_request +from tribler.core.components.tag.community.tag_payload import TagOperation, TagOperationEnum +from tribler.core.components.tag.restapi.tags_endpoint import TagsEndpoint +from tribler.core.conftest import TEST_PERSONAL_KEY +from tribler.core.utilities.unicode import hexlify # pylint: disable=redefined-outer-name diff --git a/src/tribler-core/tribler_core/components/tag/rules/tag_rules.py b/src/tribler/core/components/tag/rules/tag_rules.py similarity index 97% rename from src/tribler-core/tribler_core/components/tag/rules/tag_rules.py rename to src/tribler/core/components/tag/rules/tag_rules.py index 76b1411e77c..b34a4151592 100644 --- a/src/tribler-core/tribler_core/components/tag/rules/tag_rules.py +++ b/src/tribler/core/components/tag/rules/tag_rules.py @@ -1,7 +1,7 @@ import re from typing import AnyStr, Iterable, Optional, Pattern, Sequence -from tribler_core.components.tag.community.tag_validator import is_valid_tag +from tribler.core.components.tag.community.tag_validator import is_valid_tag # Each regex expression should contain just a single capturing group: square_brackets_re = re.compile(r'\[([^\[\]]+)]') diff --git a/src/tribler-core/tribler_core/components/tag/rules/tag_rules_processor.py b/src/tribler/core/components/tag/rules/tag_rules_processor.py similarity index 91% rename from src/tribler-core/tribler_core/components/tag/rules/tag_rules_processor.py rename to src/tribler/core/components/tag/rules/tag_rules_processor.py index 0ee2906565d..4ee64616654 100644 --- a/src/tribler-core/tribler_core/components/tag/rules/tag_rules_processor.py +++ b/src/tribler/core/components/tag/rules/tag_rules_processor.py @@ -5,12 +5,12 @@ from pony.orm import db_session -from tribler_core import notifications -from tribler_core.components.metadata_store.db.serialization import REGULAR_TORRENT -from tribler_core.components.metadata_store.db.store import MetadataStore -from tribler_core.components.tag.db.tag_db import TagDatabase -from tribler_core.components.tag.rules.tag_rules import extract_only_valid_tags -from tribler_core.utilities.notifier import Notifier +from tribler.core import notifications +from tribler.core.components.metadata_store.db.serialization import REGULAR_TORRENT +from tribler.core.components.metadata_store.db.store import MetadataStore +from tribler.core.components.tag.db.tag_db import TagDatabase +from tribler.core.components.tag.rules.tag_rules import extract_only_valid_tags +from tribler.core.utilities.notifier import Notifier DEFAULT_INTERVAL = 10 DEFAULT_BATCH_SIZE = 1000 diff --git a/src/tribler-core/tribler_core/components/tag/rules/tests/test_general_rules.py b/src/tribler/core/components/tag/rules/tests/test_general_rules.py similarity index 97% rename from src/tribler-core/tribler_core/components/tag/rules/tests/test_general_rules.py rename to src/tribler/core/components/tag/rules/tests/test_general_rules.py index fa6b93e149c..d2daf92d6ce 100644 --- a/src/tribler-core/tribler_core/components/tag/rules/tests/test_general_rules.py +++ b/src/tribler/core/components/tag/rules/tests/test_general_rules.py @@ -1,6 +1,6 @@ import pytest -from tribler_core.components.tag.rules.tag_rules import ( +from tribler.core.components.tag.rules.tag_rules import ( delimiter_re, extension_re, extract_only_valid_tags, diff --git a/src/tribler-core/tribler_core/components/tag/rules/tests/test_tag_rules_processor.py b/src/tribler/core/components/tag/rules/tests/test_tag_rules_processor.py similarity index 97% rename from src/tribler-core/tribler_core/components/tag/rules/tests/test_tag_rules_processor.py rename to src/tribler/core/components/tag/rules/tests/test_tag_rules_processor.py index 0fbc3bd199a..6fdf826990c 100644 --- a/src/tribler-core/tribler_core/components/tag/rules/tests/test_tag_rules_processor.py +++ b/src/tribler/core/components/tag/rules/tests/test_tag_rules_processor.py @@ -3,8 +3,8 @@ import pytest -from tribler_core import notifications -from tribler_core.components.tag.rules.tag_rules_processor import LAST_PROCESSED_TORRENT_ID, TagRulesProcessor +from tribler.core import notifications +from tribler.core.components.tag.rules.tag_rules_processor import LAST_PROCESSED_TORRENT_ID, TagRulesProcessor TEST_BATCH_SIZE = 100 TEST_INTERVAL = 0.1 diff --git a/src/tribler-core/tribler_core/components/tag/tag_component.py b/src/tribler/core/components/tag/tag_component.py similarity index 75% rename from src/tribler-core/tribler_core/components/tag/tag_component.py rename to src/tribler/core/components/tag/tag_component.py index 919a42c6d01..7353ec2bd45 100644 --- a/src/tribler-core/tribler_core/components/tag/tag_component.py +++ b/src/tribler/core/components/tag/tag_component.py @@ -1,12 +1,12 @@ -import tribler_core.components.metadata_store.metadata_store_component as metadata_store_component -from tribler_core.components.base import Component -from tribler_core.components.ipv8.ipv8_component import Ipv8Component -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.metadata_store.utils import generate_test_channels -from tribler_core.components.tag.community.tag_community import TagCommunity -from tribler_core.components.tag.db.tag_db import TagDatabase -from tribler_core.components.tag.rules.tag_rules_processor import TagRulesProcessor -from tribler_core.utilities.simpledefs import STATEDIR_DB_DIR +import tribler.core.components.metadata_store.metadata_store_component as metadata_store_component +from tribler.core.components.base import Component +from tribler.core.components.ipv8.ipv8_component import Ipv8Component +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.metadata_store.utils import generate_test_channels +from tribler.core.components.tag.community.tag_community import TagCommunity +from tribler.core.components.tag.db.tag_db import TagDatabase +from tribler.core.components.tag.rules.tag_rules_processor import TagRulesProcessor +from tribler.core.utilities.simpledefs import STATEDIR_DB_DIR class TagComponent(Component): diff --git a/src/tribler-core/tribler_core/components/tag/tag_constants.py b/src/tribler/core/components/tag/tag_constants.py similarity index 100% rename from src/tribler-core/tribler_core/components/tag/tag_constants.py rename to src/tribler/core/components/tag/tag_constants.py diff --git a/src/tribler-core/tribler_core/components/tag/tests/test_tag_component.py b/src/tribler/core/components/tag/tests/test_tag_component.py similarity index 60% rename from src/tribler-core/tribler_core/components/tag/tests/test_tag_component.py rename to src/tribler/core/components/tag/tests/test_tag_component.py index 2d17d76a629..716ddbdae1a 100644 --- a/src/tribler-core/tribler_core/components/tag/tests/test_tag_component.py +++ b/src/tribler/core/components/tag/tests/test_tag_component.py @@ -1,10 +1,10 @@ import pytest -from tribler_core.components.base import Session -from tribler_core.components.ipv8.ipv8_component import Ipv8Component -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent -from tribler_core.components.tag.tag_component import TagComponent +from tribler.core.components.base import Session +from tribler.core.components.ipv8.ipv8_component import Ipv8Component +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.metadata_store.metadata_store_component import MetadataStoreComponent +from tribler.core.components.tag.tag_component import TagComponent # pylint: disable=protected-access diff --git a/src/tribler-core/tribler_core/components/tests/test_base_component.py b/src/tribler/core/components/tests/test_base_component.py similarity index 98% rename from src/tribler-core/tribler_core/components/tests/test_base_component.py rename to src/tribler/core/components/tests/test_base_component.py index f7525f796ba..223ba7a4aa0 100644 --- a/src/tribler-core/tribler_core/components/tests/test_base_component.py +++ b/src/tribler/core/components/tests/test_base_component.py @@ -1,6 +1,6 @@ import pytest -from tribler_core.components.base import Component, MissedDependency, NoneComponent, Session, SessionError +from tribler.core.components.base import Component, MissedDependency, NoneComponent, Session, SessionError pytestmark = pytest.mark.asyncio diff --git a/src/tribler-core/tribler_core/components/torrent_checker/torrent_checker/tests/__init__.py b/src/tribler/core/components/torrent_checker/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/torrent_checker/torrent_checker/tests/__init__.py rename to src/tribler/core/components/torrent_checker/__init__.py diff --git a/src/tribler-core/tribler_core/components/torrent_checker/settings.py b/src/tribler/core/components/torrent_checker/settings.py similarity index 58% rename from src/tribler-core/tribler_core/components/torrent_checker/settings.py rename to src/tribler/core/components/torrent_checker/settings.py index cad20dad813..075b0bade65 100644 --- a/src/tribler-core/tribler_core/components/torrent_checker/settings.py +++ b/src/tribler/core/components/torrent_checker/settings.py @@ -1,4 +1,4 @@ -from tribler_core.config.tribler_config_section import TriblerConfigSection +from tribler.core.config.tribler_config_section import TriblerConfigSection class TorrentCheckerSettings(TriblerConfigSection): diff --git a/src/tribler-core/tribler_core/components/torrent_checker/tests/test_torrent_checker_component.py b/src/tribler/core/components/torrent_checker/tests/test_torrent_checker_component.py similarity index 58% rename from src/tribler-core/tribler_core/components/torrent_checker/tests/test_torrent_checker_component.py rename to src/tribler/core/components/torrent_checker/tests/test_torrent_checker_component.py index d738a71a606..d2dce6506db 100644 --- a/src/tribler-core/tribler_core/components/torrent_checker/tests/test_torrent_checker_component.py +++ b/src/tribler/core/components/torrent_checker/tests/test_torrent_checker_component.py @@ -1,13 +1,13 @@ import pytest -from tribler_core.components.base import Session -from tribler_core.components.ipv8.ipv8_component import Ipv8Component -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.libtorrent.libtorrent_component import LibtorrentComponent -from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent -from tribler_core.components.socks_servers.socks_servers_component import SocksServersComponent -from tribler_core.components.tag.tag_component import TagComponent -from tribler_core.components.torrent_checker.torrent_checker_component import TorrentCheckerComponent +from tribler.core.components.base import Session +from tribler.core.components.ipv8.ipv8_component import Ipv8Component +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.libtorrent.libtorrent_component import LibtorrentComponent +from tribler.core.components.metadata_store.metadata_store_component import MetadataStoreComponent +from tribler.core.components.socks_servers.socks_servers_component import SocksServersComponent +from tribler.core.components.tag.tag_component import TagComponent +from tribler.core.components.torrent_checker.torrent_checker_component import TorrentCheckerComponent # pylint: disable=protected-access diff --git a/src/tribler-core/tribler_core/components/torrent_checker/torrent_checker/__init__.py b/src/tribler/core/components/torrent_checker/torrent_checker/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/torrent_checker/torrent_checker/__init__.py rename to src/tribler/core/components/torrent_checker/torrent_checker/__init__.py diff --git a/src/tribler-core/tribler_core/components/tunnel/__init__.py b/src/tribler/core/components/torrent_checker/torrent_checker/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/tunnel/__init__.py rename to src/tribler/core/components/torrent_checker/torrent_checker/tests/__init__.py diff --git a/src/tribler-core/tribler_core/components/torrent_checker/torrent_checker/tests/test_torrentchecker.py b/src/tribler/core/components/torrent_checker/torrent_checker/tests/test_torrentchecker.py similarity index 97% rename from src/tribler-core/tribler_core/components/torrent_checker/torrent_checker/tests/test_torrentchecker.py rename to src/tribler/core/components/torrent_checker/torrent_checker/tests/test_torrentchecker.py index 3fa69eab020..2dde29ddc94 100644 --- a/src/tribler-core/tribler_core/components/torrent_checker/torrent_checker/tests/test_torrentchecker.py +++ b/src/tribler/core/components/torrent_checker/torrent_checker/tests/test_torrentchecker.py @@ -11,13 +11,13 @@ import pytest -import tribler_core.components.torrent_checker.torrent_checker.torrent_checker as torrent_checker_module -from tribler_core.components.torrent_checker.torrent_checker.torrent_checker import TorrentChecker -from tribler_core.components.torrent_checker.torrent_checker.torrentchecker_session import HttpTrackerSession, \ +import tribler.core.components.torrent_checker.torrent_checker.torrent_checker as torrent_checker_module +from tribler.core.components.torrent_checker.torrent_checker.torrent_checker import TorrentChecker +from tribler.core.components.torrent_checker.torrent_checker.torrentchecker_session import HttpTrackerSession, \ UdpSocketManager -from tribler_core.components.torrent_checker.torrent_checker.tracker_manager import TrackerManager -from tribler_core.tests.tools.base_test import MockObject -from tribler_core.utilities.unicode import hexlify +from tribler.core.components.torrent_checker.torrent_checker.tracker_manager import TrackerManager +from tribler.core.tests.tools.base_test import MockObject +from tribler.core.utilities.unicode import hexlify @pytest.fixture diff --git a/src/tribler-core/tribler_core/components/torrent_checker/torrent_checker/tests/test_torrentchecker_session.py b/src/tribler/core/components/torrent_checker/torrent_checker/tests/test_torrentchecker_session.py similarity index 99% rename from src/tribler-core/tribler_core/components/torrent_checker/torrent_checker/tests/test_torrentchecker_session.py rename to src/tribler/core/components/torrent_checker/torrent_checker/tests/test_torrentchecker_session.py index 9478407a7d3..5cf38eb97af 100644 --- a/src/tribler-core/tribler_core/components/torrent_checker/torrent_checker/tests/test_torrentchecker_session.py +++ b/src/tribler/core/components/torrent_checker/torrent_checker/tests/test_torrentchecker_session.py @@ -11,14 +11,14 @@ import pytest -from tribler_core.components.torrent_checker.torrent_checker.torrentchecker_session import ( +from tribler.core.components.torrent_checker.torrent_checker.torrentchecker_session import ( FakeBep33DHTSession, FakeDHTSession, HttpTrackerSession, UdpSocketManager, UdpTrackerSession, ) -from tribler_core.utilities.unicode import hexlify +from tribler.core.utilities.unicode import hexlify class FakeUdpSocketManager: diff --git a/src/tribler-core/tribler_core/components/torrent_checker/torrent_checker/tests/test_tracker_manager.py b/src/tribler/core/components/torrent_checker/torrent_checker/tests/test_tracker_manager.py similarity index 98% rename from src/tribler-core/tribler_core/components/torrent_checker/torrent_checker/tests/test_tracker_manager.py rename to src/tribler/core/components/torrent_checker/torrent_checker/tests/test_tracker_manager.py index 88c343e6d73..5a92a080398 100644 --- a/src/tribler-core/tribler_core/components/torrent_checker/torrent_checker/tests/test_tracker_manager.py +++ b/src/tribler/core/components/torrent_checker/torrent_checker/tests/test_tracker_manager.py @@ -1,6 +1,6 @@ import pytest -from tribler_core.components.torrent_checker.torrent_checker.tracker_manager import TrackerManager +from tribler.core.components.torrent_checker.torrent_checker.tracker_manager import TrackerManager @pytest.fixture diff --git a/src/tribler-core/tribler_core/components/torrent_checker/torrent_checker/torrent_checker.py b/src/tribler/core/components/torrent_checker/torrent_checker/torrent_checker.py similarity index 96% rename from src/tribler-core/tribler_core/components/torrent_checker/torrent_checker/torrent_checker.py rename to src/tribler/core/components/torrent_checker/torrent_checker/torrent_checker.py index 72b4aa7df74..2fea2b821f5 100644 --- a/src/tribler-core/tribler_core/components/torrent_checker/torrent_checker/torrent_checker.py +++ b/src/tribler/core/components/torrent_checker/torrent_checker/torrent_checker.py @@ -9,22 +9,22 @@ from pony.orm import db_session, desc, select -from tribler_core import notifications -from tribler_core.components.libtorrent.download_manager.download_manager import DownloadManager -from tribler_core.components.metadata_store.db.serialization import REGULAR_TORRENT -from tribler_core.components.metadata_store.db.store import MetadataStore -from tribler_core.components.torrent_checker.torrent_checker.torrentchecker_session import ( +from tribler.core import notifications +from tribler.core.components.libtorrent.download_manager.download_manager import DownloadManager +from tribler.core.components.metadata_store.db.serialization import REGULAR_TORRENT +from tribler.core.components.metadata_store.db.store import MetadataStore +from tribler.core.components.torrent_checker.torrent_checker.torrentchecker_session import ( FakeBep33DHTSession, FakeDHTSession, UdpSocketManager, create_tracker_session, ) -from tribler_core.components.torrent_checker.torrent_checker.tracker_manager import MAX_TRACKER_FAILURES, TrackerManager -from tribler_core.config.tribler_config import TriblerConfig -from tribler_core.utilities.notifier import Notifier -from tribler_core.utilities.tracker_utils import MalformedTrackerURLException -from tribler_core.utilities.unicode import hexlify -from tribler_core.utilities.utilities import has_bep33_support, is_valid_url +from tribler.core.components.torrent_checker.torrent_checker.tracker_manager import MAX_TRACKER_FAILURES, TrackerManager +from tribler.core.config.tribler_config import TriblerConfig +from tribler.core.utilities.notifier import Notifier +from tribler.core.utilities.tracker_utils import MalformedTrackerURLException +from tribler.core.utilities.unicode import hexlify +from tribler.core.utilities.utilities import has_bep33_support, is_valid_url TRACKER_SELECTION_INTERVAL = 20 # The interval for querying a random tracker TORRENT_SELECTION_INTERVAL = 120 # The interval for checking the health of a random torrent diff --git a/src/tribler-core/tribler_core/components/torrent_checker/torrent_checker/torrentchecker_session.py b/src/tribler/core/components/torrent_checker/torrent_checker/torrentchecker_session.py similarity index 98% rename from src/tribler-core/tribler_core/components/torrent_checker/torrent_checker/torrentchecker_session.py rename to src/tribler/core/components/torrent_checker/torrent_checker/torrentchecker_session.py index 0901f58c56c..02d3111b014 100644 --- a/src/tribler-core/tribler_core/components/torrent_checker/torrent_checker/torrentchecker_session.py +++ b/src/tribler/core/components/torrent_checker/torrent_checker/torrentchecker_session.py @@ -12,12 +12,12 @@ import async_timeout from ipv8.taskmanager import TaskManager -from tribler_core.components.socks_servers.socks5.aiohttp_connector import Socks5Connector -from tribler_core.components.socks_servers.socks5.client import Socks5Client +from tribler.core.components.socks_servers.socks5.aiohttp_connector import Socks5Connector +from tribler.core.components.socks_servers.socks5.client import Socks5Client -from tribler_core.utilities.tracker_utils import add_url_params, parse_tracker_url -from tribler_core.utilities.unicode import hexlify -from tribler_core.utilities.utilities import bdecode_compat +from tribler.core.utilities.tracker_utils import add_url_params, parse_tracker_url +from tribler.core.utilities.unicode import hexlify +from tribler.core.utilities.utilities import bdecode_compat # Although these are the actions for UDP trackers, they can still be used as # identifiers. diff --git a/src/tribler-core/tribler_core/components/torrent_checker/torrent_checker/tracker_manager.py b/src/tribler/core/components/torrent_checker/torrent_checker/tracker_manager.py similarity index 97% rename from src/tribler-core/tribler_core/components/torrent_checker/torrent_checker/tracker_manager.py rename to src/tribler/core/components/torrent_checker/torrent_checker/tracker_manager.py index 04e229a810e..abebafed913 100644 --- a/src/tribler-core/tribler_core/components/torrent_checker/torrent_checker/tracker_manager.py +++ b/src/tribler/core/components/torrent_checker/torrent_checker/tracker_manager.py @@ -4,8 +4,8 @@ from pony.orm import count, db_session -from tribler_core.components.metadata_store.db.store import MetadataStore -from tribler_core.utilities.tracker_utils import get_uniformed_tracker_url +from tribler.core.components.metadata_store.db.store import MetadataStore +from tribler.core.utilities.tracker_utils import get_uniformed_tracker_url MAX_TRACKER_FAILURES = 5 # if a tracker fails this amount of times in a row, its 'is_alive' will be marked as 0 (dead). TRACKER_RETRY_INTERVAL = 60 # A "dead" tracker will be retired every 60 seconds diff --git a/src/tribler-core/tribler_core/components/torrent_checker/torrent_checker_component.py b/src/tribler/core/components/torrent_checker/torrent_checker_component.py similarity index 79% rename from src/tribler-core/tribler_core/components/torrent_checker/torrent_checker_component.py rename to src/tribler/core/components/torrent_checker/torrent_checker_component.py index 92c18d49ac9..614e87ab5ce 100644 --- a/src/tribler-core/tribler_core/components/torrent_checker/torrent_checker_component.py +++ b/src/tribler/core/components/torrent_checker/torrent_checker_component.py @@ -1,9 +1,9 @@ -from tribler_core.components.base import Component -from tribler_core.components.libtorrent.libtorrent_component import LibtorrentComponent -from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent -from tribler_core.components.socks_servers.socks_servers_component import SocksServersComponent -from tribler_core.components.torrent_checker.torrent_checker.torrent_checker import TorrentChecker -from tribler_core.components.torrent_checker.torrent_checker.tracker_manager import TrackerManager +from tribler.core.components.base import Component +from tribler.core.components.libtorrent.libtorrent_component import LibtorrentComponent +from tribler.core.components.metadata_store.metadata_store_component import MetadataStoreComponent +from tribler.core.components.socks_servers.socks_servers_component import SocksServersComponent +from tribler.core.components.torrent_checker.torrent_checker.torrent_checker import TorrentChecker +from tribler.core.components.torrent_checker.torrent_checker.tracker_manager import TrackerManager class TorrentCheckerComponent(Component): diff --git a/src/tribler-core/tribler_core/components/tunnel/tests/__init__.py b/src/tribler/core/components/tunnel/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/tunnel/tests/__init__.py rename to src/tribler/core/components/tunnel/__init__.py diff --git a/src/tribler-core/tribler_core/components/tunnel/community/__init__.py b/src/tribler/core/components/tunnel/community/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/tunnel/community/__init__.py rename to src/tribler/core/components/tunnel/community/__init__.py diff --git a/src/tribler-core/tribler_core/components/tunnel/community/caches.py b/src/tribler/core/components/tunnel/community/caches.py similarity index 100% rename from src/tribler-core/tribler_core/components/tunnel/community/caches.py rename to src/tribler/core/components/tunnel/community/caches.py diff --git a/src/tribler-core/tribler_core/components/tunnel/community/discovery.py b/src/tribler/core/components/tunnel/community/discovery.py similarity index 100% rename from src/tribler-core/tribler_core/components/tunnel/community/discovery.py rename to src/tribler/core/components/tunnel/community/discovery.py diff --git a/src/tribler-core/tribler_core/components/tunnel/community/dispatcher.py b/src/tribler/core/components/tunnel/community/dispatcher.py similarity index 99% rename from src/tribler-core/tribler_core/components/tunnel/community/dispatcher.py rename to src/tribler/core/components/tunnel/community/dispatcher.py index 8b4e0830416..d7a3b2cb135 100644 --- a/src/tribler-core/tribler_core/components/tunnel/community/dispatcher.py +++ b/src/tribler/core/components/tunnel/community/dispatcher.py @@ -10,7 +10,7 @@ ) from ipv8.taskmanager import TaskManager, task -from tribler_core.components.socks_servers.socks5.conversion import UdpPacket, socks5_serializer +from tribler.core.components.socks_servers.socks5.conversion import UdpPacket, socks5_serializer class TunnelDispatcher(TaskManager): diff --git a/src/tribler-core/tribler_core/components/tunnel/community/payload.py b/src/tribler/core/components/tunnel/community/payload.py similarity index 100% rename from src/tribler-core/tribler_core/components/tunnel/community/payload.py rename to src/tribler/core/components/tunnel/community/payload.py diff --git a/src/tribler-core/tribler_core/components/tunnel/community/tunnel_community.py b/src/tribler/core/components/tunnel/community/tunnel_community.py similarity index 98% rename from src/tribler-core/tribler_core/components/tunnel/community/tunnel_community.py rename to src/tribler/core/components/tunnel/community/tunnel_community.py index 1d44f37a180..9563718664e 100644 --- a/src/tribler-core/tribler_core/components/tunnel/community/tunnel_community.py +++ b/src/tribler/core/components/tunnel/community/tunnel_community.py @@ -32,13 +32,13 @@ from ipv8.types import Address from ipv8.util import succeed -from tribler_core import notifications -from tribler_core.components.bandwidth_accounting.db.transaction import BandwidthTransactionData -from tribler_core.components.socks_servers.socks5.server import Socks5Server -from tribler_core.components.tunnel.community.caches import BalanceRequestCache, HTTPRequestCache -from tribler_core.components.tunnel.community.discovery import GoldenRatioStrategy -from tribler_core.components.tunnel.community.dispatcher import TunnelDispatcher -from tribler_core.components.tunnel.community.payload import ( +from tribler.core import notifications +from tribler.core.components.bandwidth_accounting.db.transaction import BandwidthTransactionData +from tribler.core.components.socks_servers.socks5.server import Socks5Server +from tribler.core.components.tunnel.community.caches import BalanceRequestCache, HTTPRequestCache +from tribler.core.components.tunnel.community.discovery import GoldenRatioStrategy +from tribler.core.components.tunnel.community.dispatcher import TunnelDispatcher +from tribler.core.components.tunnel.community.payload import ( BalanceRequestPayload, BalanceResponsePayload, BandwidthTransactionPayload, @@ -47,14 +47,14 @@ RelayBalanceRequestPayload, RelayBalanceResponsePayload, ) -from tribler_core.utilities.bencodecheck import is_bencoded -from tribler_core.utilities.simpledefs import ( +from tribler.core.utilities.bencodecheck import is_bencoded +from tribler.core.utilities.simpledefs import ( DLSTATUS_DOWNLOADING, DLSTATUS_METADATA, DLSTATUS_SEEDING, DLSTATUS_STOPPED, ) -from tribler_core.utilities.unicode import hexlify +from tribler.core.utilities.unicode import hexlify DESTROY_REASON_BALANCE = 65535 diff --git a/src/tribler-core/tribler_core/components/tunnel/settings.py b/src/tribler/core/components/tunnel/settings.py similarity index 83% rename from src/tribler-core/tribler_core/components/tunnel/settings.py rename to src/tribler/core/components/tunnel/settings.py index 0a869f777f3..92ee8b86610 100644 --- a/src/tribler-core/tribler_core/components/tunnel/settings.py +++ b/src/tribler/core/components/tunnel/settings.py @@ -1,6 +1,6 @@ from pydantic import Field -from tribler_core.config.tribler_config_section import TriblerConfigSection +from tribler.core.config.tribler_config_section import TriblerConfigSection class TunnelCommunitySettings(TriblerConfigSection): diff --git a/src/tribler-core/tribler_core/components/version_check/__init__.py b/src/tribler/core/components/tunnel/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/version_check/__init__.py rename to src/tribler/core/components/tunnel/tests/__init__.py diff --git a/src/tribler-core/tribler_core/components/tunnel/tests/test_discovery.py b/src/tribler/core/components/tunnel/tests/test_discovery.py similarity index 97% rename from src/tribler-core/tribler_core/components/tunnel/tests/test_discovery.py rename to src/tribler/core/components/tunnel/tests/test_discovery.py index cf7848056c0..4b096495244 100644 --- a/src/tribler-core/tribler_core/components/tunnel/tests/test_discovery.py +++ b/src/tribler/core/components/tunnel/tests/test_discovery.py @@ -5,7 +5,7 @@ from ipv8.peer import Peer from ipv8.peerdiscovery.network import Network -from tribler_core.components.tunnel.community.discovery import GoldenRatioStrategy +from tribler.core.components.tunnel.community.discovery import GoldenRatioStrategy class FakeOverlay: diff --git a/src/tribler-core/tribler_core/components/tunnel/tests/test_dispatcher.py b/src/tribler/core/components/tunnel/tests/test_dispatcher.py similarity index 98% rename from src/tribler-core/tribler_core/components/tunnel/tests/test_dispatcher.py rename to src/tribler/core/components/tunnel/tests/test_dispatcher.py index 60237a10e8e..6f2a59ab8ef 100644 --- a/src/tribler-core/tribler_core/components/tunnel/tests/test_dispatcher.py +++ b/src/tribler/core/components/tunnel/tests/test_dispatcher.py @@ -5,7 +5,7 @@ import pytest -from tribler_core.components.tunnel.community.dispatcher import TunnelDispatcher +from tribler.core.components.tunnel.community.dispatcher import TunnelDispatcher @pytest.fixture(name='dispatcher') diff --git a/src/tribler-core/tribler_core/components/tunnel/tests/test_full_session/__init__.py b/src/tribler/core/components/tunnel/tests/test_full_session/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/tunnel/tests/test_full_session/__init__.py rename to src/tribler/core/components/tunnel/tests/test_full_session/__init__.py diff --git a/src/tribler-core/tribler_core/components/tunnel/tests/test_full_session/conftest.py b/src/tribler/core/components/tunnel/tests/test_full_session/conftest.py similarity index 100% rename from src/tribler-core/tribler_core/components/tunnel/tests/test_full_session/conftest.py rename to src/tribler/core/components/tunnel/tests/test_full_session/conftest.py diff --git a/src/tribler-core/tribler_core/components/tunnel/tests/test_full_session/test_tunnel_community.py b/src/tribler/core/components/tunnel/tests/test_full_session/test_tunnel_community.py similarity index 93% rename from src/tribler-core/tribler_core/components/tunnel/tests/test_full_session/test_tunnel_community.py rename to src/tribler/core/components/tunnel/tests/test_full_session/test_tunnel_community.py index 011ffeb445a..7e285abd8f4 100644 --- a/src/tribler-core/tribler_core/components/tunnel/tests/test_full_session/test_tunnel_community.py +++ b/src/tribler/core/components/tunnel/tests/test_full_session/test_tunnel_community.py @@ -20,16 +20,16 @@ # Pylint does not agree with the way pytest handles fixtures. # pylint: disable=W0613,W0621 -from tribler_core.components.libtorrent.download_manager.download_config import DownloadConfig -from tribler_core.components.libtorrent.download_manager.download_manager import DownloadManager -from tribler_core.components.libtorrent.settings import LibtorrentSettings -from tribler_core.components.libtorrent.torrentdef import TorrentDef -from tribler_core.components.socks_servers.socks5.server import Socks5Server -from tribler_core.components.socks_servers.socks_servers_component import NUM_SOCKS_PROXIES -from tribler_core.components.tunnel.community.tunnel_community import TriblerTunnelCommunity -from tribler_core.components.tunnel.settings import TunnelCommunitySettings -from tribler_core.tests.tools.common import TESTS_DATA_DIR -from tribler_core.utilities.simpledefs import DLSTATUS_DOWNLOADING, DLSTATUS_SEEDING, dlstatus_strings +from tribler.core.components.libtorrent.download_manager.download_config import DownloadConfig +from tribler.core.components.libtorrent.download_manager.download_manager import DownloadManager +from tribler.core.components.libtorrent.settings import LibtorrentSettings +from tribler.core.components.libtorrent.torrentdef import TorrentDef +from tribler.core.components.socks_servers.socks5.server import Socks5Server +from tribler.core.components.socks_servers.socks_servers_component import NUM_SOCKS_PROXIES +from tribler.core.components.tunnel.community.tunnel_community import TriblerTunnelCommunity +from tribler.core.components.tunnel.settings import TunnelCommunitySettings +from tribler.core.tests.tools.common import TESTS_DATA_DIR +from tribler.core.utilities.simpledefs import DLSTATUS_DOWNLOADING, DLSTATUS_SEEDING, dlstatus_strings def crash_on_error(): diff --git a/src/tribler-core/tribler_core/components/tunnel/tests/test_triblertunnel_community.py b/src/tribler/core/components/tunnel/tests/test_triblertunnel_community.py similarity index 97% rename from src/tribler-core/tribler_core/components/tunnel/tests/test_triblertunnel_community.py rename to src/tribler/core/components/tunnel/tests/test_triblertunnel_community.py index aa61b5de97f..c6382329fca 100644 --- a/src/tribler-core/tribler_core/components/tunnel/tests/test_triblertunnel_community.py +++ b/src/tribler/core/components/tunnel/tests/test_triblertunnel_community.py @@ -19,19 +19,19 @@ from ipv8.test.mocking.ipv8 import MockIPv8 from ipv8.util import succeed -from tribler_core.components.bandwidth_accounting.community.bandwidth_accounting_community import ( +from tribler.core.components.bandwidth_accounting.community.bandwidth_accounting_community import ( BandwidthAccountingCommunity, ) -from tribler_core.components.bandwidth_accounting.db.database import BandwidthDatabase -from tribler_core.components.bandwidth_accounting.settings import BandwidthAccountingSettings -from tribler_core.components.tunnel.community.payload import BandwidthTransactionPayload -from tribler_core.components.tunnel.community.tunnel_community import PEER_FLAG_EXIT_HTTP, TriblerTunnelCommunity -from tribler_core.components.tunnel.settings import TunnelCommunitySettings -from tribler_core.tests.tools.base_test import MockObject -from tribler_core.tests.tools.tracker.http_tracker import HTTPTracker -from tribler_core.utilities.network_utils import NetworkUtils -from tribler_core.utilities.path_util import Path -from tribler_core.utilities.utilities import MEMORY_DB +from tribler.core.components.bandwidth_accounting.db.database import BandwidthDatabase +from tribler.core.components.bandwidth_accounting.settings import BandwidthAccountingSettings +from tribler.core.components.tunnel.community.payload import BandwidthTransactionPayload +from tribler.core.components.tunnel.community.tunnel_community import PEER_FLAG_EXIT_HTTP, TriblerTunnelCommunity +from tribler.core.components.tunnel.settings import TunnelCommunitySettings +from tribler.core.tests.tools.base_test import MockObject +from tribler.core.tests.tools.tracker.http_tracker import HTTPTracker +from tribler.core.utilities.network_utils import NetworkUtils +from tribler.core.utilities.path_util import Path +from tribler.core.utilities.utilities import MEMORY_DB class TestTriblerTunnelCommunity(TestBase): # pylint: disable=too-many-public-methods diff --git a/src/tribler-core/tribler_core/components/tunnel/tests/test_tunnel_component.py b/src/tribler/core/components/tunnel/tests/test_tunnel_component.py similarity index 66% rename from src/tribler-core/tribler_core/components/tunnel/tests/test_tunnel_component.py rename to src/tribler/core/components/tunnel/tests/test_tunnel_component.py index 73515fd7fb0..9ea3f27a578 100644 --- a/src/tribler-core/tribler_core/components/tunnel/tests/test_tunnel_component.py +++ b/src/tribler/core/components/tunnel/tests/test_tunnel_component.py @@ -1,9 +1,9 @@ import pytest -from tribler_core.components.base import Session -from tribler_core.components.ipv8.ipv8_component import Ipv8Component -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.tunnel.tunnel_component import TunnelsComponent +from tribler.core.components.base import Session +from tribler.core.components.ipv8.ipv8_component import Ipv8Component +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.tunnel.tunnel_component import TunnelsComponent # pylint: disable=protected-access diff --git a/src/tribler-core/tribler_core/components/tunnel/tests/test_tunnel_settings.py b/src/tribler/core/components/tunnel/tests/test_tunnel_settings.py similarity index 67% rename from src/tribler-core/tribler_core/components/tunnel/tests/test_tunnel_settings.py rename to src/tribler/core/components/tunnel/tests/test_tunnel_settings.py index 8dcf98e9955..61e32ce0617 100644 --- a/src/tribler-core/tribler_core/components/tunnel/tests/test_tunnel_settings.py +++ b/src/tribler/core/components/tunnel/tests/test_tunnel_settings.py @@ -1,7 +1,7 @@ import pytest -from tribler_core.components.ipv8.settings import Ipv8Settings -from tribler_core.utilities.network_utils import NetworkUtils +from tribler.core.components.ipv8.settings import Ipv8Settings +from tribler.core.utilities.network_utils import NetworkUtils @pytest.mark.asyncio diff --git a/src/tribler-core/tribler_core/components/tunnel/tunnel_component.py b/src/tribler/core/components/tunnel/tunnel_component.py similarity index 87% rename from src/tribler-core/tribler_core/components/tunnel/tunnel_component.py rename to src/tribler/core/components/tunnel/tunnel_component.py index 12185a15836..3e71d741465 100644 --- a/src/tribler-core/tribler_core/components/tunnel/tunnel_component.py +++ b/src/tribler/core/components/tunnel/tunnel_component.py @@ -1,13 +1,13 @@ from ipv8.dht.provider import DHTCommunityProvider from ipv8.messaging.anonymization.community import TunnelSettings -from tribler_core.components.bandwidth_accounting.bandwidth_accounting_component import BandwidthAccountingComponent -from tribler_core.components.base import Component -from tribler_core.components.ipv8.ipv8_component import INFINITE, Ipv8Component -from tribler_core.components.libtorrent.libtorrent_component import LibtorrentComponent -from tribler_core.components.socks_servers.socks_servers_component import SocksServersComponent -from tribler_core.components.tunnel.community.discovery import GoldenRatioStrategy -from tribler_core.components.tunnel.community.tunnel_community import ( +from tribler.core.components.bandwidth_accounting.bandwidth_accounting_component import BandwidthAccountingComponent +from tribler.core.components.base import Component +from tribler.core.components.ipv8.ipv8_component import INFINITE, Ipv8Component +from tribler.core.components.libtorrent.libtorrent_component import LibtorrentComponent +from tribler.core.components.socks_servers.socks_servers_component import SocksServersComponent +from tribler.core.components.tunnel.community.discovery import GoldenRatioStrategy +from tribler.core.components.tunnel.community.tunnel_community import ( TriblerTunnelCommunity, TriblerTunnelTestnetCommunity, ) diff --git a/src/tribler-core/tribler_core/components/version_check/tests/__init__.py b/src/tribler/core/components/version_check/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/version_check/tests/__init__.py rename to src/tribler/core/components/version_check/__init__.py diff --git a/src/tribler-core/tribler_core/components/watch_folder/__init__.py b/src/tribler/core/components/version_check/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/watch_folder/__init__.py rename to src/tribler/core/components/version_check/tests/__init__.py diff --git a/src/tribler-core/tribler_core/components/version_check/tests/test_version_check_component.py b/src/tribler/core/components/version_check/tests/test_version_check_component.py similarity index 79% rename from src/tribler-core/tribler_core/components/version_check/tests/test_version_check_component.py rename to src/tribler/core/components/version_check/tests/test_version_check_component.py index 0bbe1d42075..80f3111676f 100644 --- a/src/tribler-core/tribler_core/components/version_check/tests/test_version_check_component.py +++ b/src/tribler/core/components/version_check/tests/test_version_check_component.py @@ -1,7 +1,7 @@ import pytest -from tribler_core.components.base import Session -from tribler_core.components.version_check.version_check_component import VersionCheckComponent +from tribler.core.components.base import Session +from tribler.core.components.version_check.version_check_component import VersionCheckComponent pytestmark = pytest.mark.asyncio diff --git a/src/tribler-core/tribler_core/components/version_check/tests/test_versioncheck.py b/src/tribler/core/components/version_check/tests/test_versioncheck.py similarity index 94% rename from src/tribler-core/tribler_core/components/version_check/tests/test_versioncheck.py rename to src/tribler/core/components/version_check/tests/test_versioncheck.py index b815f360838..88fcf685a6d 100644 --- a/src/tribler-core/tribler_core/components/version_check/tests/test_versioncheck.py +++ b/src/tribler/core/components/version_check/tests/test_versioncheck.py @@ -6,10 +6,10 @@ import pytest -from tribler_core.components.restapi.rest.rest_endpoint import RESTResponse -from tribler_core.components.version_check import versioncheck_manager -from tribler_core.components.version_check.versioncheck_manager import VersionCheckManager, get_user_agent_string -from tribler_core.version import version_id +from tribler.core.components.restapi.rest.rest_endpoint import RESTResponse +from tribler.core.components.version_check import versioncheck_manager +from tribler.core.components.version_check.versioncheck_manager import VersionCheckManager, get_user_agent_string +from tribler.core.version import version_id # pylint: disable=unused-argument @@ -90,7 +90,7 @@ async def test_start(version_check_manager, version_server): # We only start the version check if GIT is not in the version ID. assert not version_check_manager.is_pending_task_active("tribler version check") - import tribler_core.components.version_check.versioncheck_manager as vcm # pylint: disable=reimported, import-outside-toplevel + import tribler.core.components.version_check.versioncheck_manager as vcm # pylint: disable=reimported, import-outside-toplevel old_id = vcm.version_id vcm.version_id = "7.0.0" version_check_manager.start() @@ -148,7 +148,7 @@ async def test_version_check_api_timeout(free_port, version_check_manager, versi response = json.dumps({'name': NEW_VERSION_ID}) response_lag = 2 # Ensures that it takes 2 seconds to send a response - import tribler_core.components.version_check.versioncheck_manager as vcm # pylint: disable=reimported, import-outside-toplevel + import tribler.core.components.version_check.versioncheck_manager as vcm # pylint: disable=reimported, import-outside-toplevel old_timeout = vcm.VERSION_CHECK_TIMEOUT vcm.VERSION_CHECK_TIMEOUT = 1 # version checker will wait for 1 second to get response @@ -172,7 +172,7 @@ async def test_fallback_on_multiple_urls(free_port, version_check_manager, versi global response # pylint: disable=global-statement response = json.dumps({'name': NEW_VERSION_ID}) - import tribler_core.components.version_check.versioncheck_manager as vcm # pylint: disable=reimported, import-outside-toplevel + import tribler.core.components.version_check.versioncheck_manager as vcm # pylint: disable=reimported, import-outside-toplevel vcm_old_urls = vcm.VERSION_CHECK_URLS vcm.VERSION_CHECK_URLS = ["http://this.will.not.exist", f"http://localhost:{free_port}"] diff --git a/src/tribler-core/tribler_core/components/version_check/version_check_component.py b/src/tribler/core/components/version_check/version_check_component.py similarity index 75% rename from src/tribler-core/tribler_core/components/version_check/version_check_component.py rename to src/tribler/core/components/version_check/version_check_component.py index 678a04c2c8d..8bff4aa9ccc 100644 --- a/src/tribler-core/tribler_core/components/version_check/version_check_component.py +++ b/src/tribler/core/components/version_check/version_check_component.py @@ -1,6 +1,6 @@ -from tribler_core.components.base import Component -from tribler_core.components.reporter.reporter_component import ReporterComponent -from tribler_core.components.version_check.versioncheck_manager import VersionCheckManager +from tribler.core.components.base import Component +from tribler.core.components.reporter.reporter_component import ReporterComponent +from tribler.core.components.version_check.versioncheck_manager import VersionCheckManager class VersionCheckComponent(Component): diff --git a/src/tribler-core/tribler_core/components/version_check/versioncheck_manager.py b/src/tribler/core/components/version_check/versioncheck_manager.py similarity index 95% rename from src/tribler-core/tribler_core/components/version_check/versioncheck_manager.py rename to src/tribler/core/components/version_check/versioncheck_manager.py index 268c25fca15..0674c440652 100644 --- a/src/tribler-core/tribler_core/components/version_check/versioncheck_manager.py +++ b/src/tribler/core/components/version_check/versioncheck_manager.py @@ -6,9 +6,9 @@ from ipv8.taskmanager import TaskManager -from tribler_core import notifications -from tribler_core.utilities.notifier import Notifier -from tribler_core.version import version_id +from tribler.core import notifications +from tribler.core.utilities.notifier import Notifier +from tribler.core.version import version_id VERSION_CHECK_URLS = [f'https://release.tribler.org/releases/latest?current={version_id}', # Tribler Release API 'https://api.github.com/repos/tribler/tribler/releases/latest'] # Fallback GitHub API diff --git a/src/tribler-core/tribler_core/components/watch_folder/tests/__init__.py b/src/tribler/core/components/watch_folder/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/components/watch_folder/tests/__init__.py rename to src/tribler/core/components/watch_folder/__init__.py diff --git a/src/tribler-core/tribler_core/components/watch_folder/settings.py b/src/tribler/core/components/watch_folder/settings.py similarity index 69% rename from src/tribler-core/tribler_core/components/watch_folder/settings.py rename to src/tribler/core/components/watch_folder/settings.py index c9fcb30b3f7..11096c15975 100644 --- a/src/tribler-core/tribler_core/components/watch_folder/settings.py +++ b/src/tribler/core/components/watch_folder/settings.py @@ -1,4 +1,4 @@ -from tribler_core.config.tribler_config_section import TriblerConfigSection +from tribler.core.config.tribler_config_section import TriblerConfigSection # pylint: disable=no-self-argument diff --git a/src/tribler-core/tribler_core/config/tests/__init__.py b/src/tribler/core/components/watch_folder/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/config/tests/__init__.py rename to src/tribler/core/components/watch_folder/tests/__init__.py diff --git a/src/tribler-core/tribler_core/components/watch_folder/tests/test_watch_folder.py b/src/tribler/core/components/watch_folder/tests/test_watch_folder.py similarity index 93% rename from src/tribler-core/tribler_core/components/watch_folder/tests/test_watch_folder.py rename to src/tribler/core/components/watch_folder/tests/test_watch_folder.py index 4f54f7565b9..35838fdd759 100644 --- a/src/tribler-core/tribler_core/components/watch_folder/tests/test_watch_folder.py +++ b/src/tribler/core/components/watch_folder/tests/test_watch_folder.py @@ -5,8 +5,8 @@ import pytest -from tribler_core.components.watch_folder.watch_folder import WatchFolder -from tribler_core.tests.tools.common import TESTS_DATA_DIR, TORRENT_UBUNTU_FILE +from tribler.core.components.watch_folder.watch_folder import WatchFolder +from tribler.core.tests.tools.common import TESTS_DATA_DIR, TORRENT_UBUNTU_FILE @pytest.fixture diff --git a/src/tribler-core/tribler_core/components/watch_folder/tests/test_watch_folder_component.py b/src/tribler/core/components/watch_folder/tests/test_watch_folder_component.py similarity index 64% rename from src/tribler-core/tribler_core/components/watch_folder/tests/test_watch_folder_component.py rename to src/tribler/core/components/watch_folder/tests/test_watch_folder_component.py index a49742c53ee..eccc56e0215 100644 --- a/src/tribler-core/tribler_core/components/watch_folder/tests/test_watch_folder_component.py +++ b/src/tribler/core/components/watch_folder/tests/test_watch_folder_component.py @@ -1,10 +1,10 @@ import pytest -from tribler_core.components.base import Session -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.libtorrent.libtorrent_component import LibtorrentComponent -from tribler_core.components.socks_servers.socks_servers_component import SocksServersComponent -from tribler_core.components.watch_folder.watch_folder_component import WatchFolderComponent +from tribler.core.components.base import Session +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.libtorrent.libtorrent_component import LibtorrentComponent +from tribler.core.components.socks_servers.socks_servers_component import SocksServersComponent +from tribler.core.components.watch_folder.watch_folder_component import WatchFolderComponent # pylint: disable=protected-access diff --git a/src/tribler-core/tribler_core/components/watch_folder/watch_folder.py b/src/tribler/core/components/watch_folder/watch_folder.py similarity index 90% rename from src/tribler-core/tribler_core/components/watch_folder/watch_folder.py rename to src/tribler/core/components/watch_folder/watch_folder.py index 494cb0e8c29..9a26e0e35ac 100644 --- a/src/tribler-core/tribler_core/components/watch_folder/watch_folder.py +++ b/src/tribler/core/components/watch_folder/watch_folder.py @@ -4,11 +4,11 @@ from ipv8.taskmanager import TaskManager -from tribler_core import notifications -from tribler_core.components.libtorrent.download_manager.download_manager import DownloadManager -from tribler_core.components.libtorrent.torrentdef import TorrentDef -from tribler_core.utilities import path_util -from tribler_core.utilities.notifier import Notifier +from tribler.core import notifications +from tribler.core.components.libtorrent.download_manager.download_manager import DownloadManager +from tribler.core.components.libtorrent.torrentdef import TorrentDef +from tribler.core.utilities import path_util +from tribler.core.utilities.notifier import Notifier WATCH_FOLDER_CHECK_INTERVAL = 10 diff --git a/src/tribler-core/tribler_core/components/watch_folder/watch_folder_component.py b/src/tribler/core/components/watch_folder/watch_folder_component.py similarity index 82% rename from src/tribler-core/tribler_core/components/watch_folder/watch_folder_component.py rename to src/tribler/core/components/watch_folder/watch_folder_component.py index dca37d2e93c..d3690cd8fbf 100644 --- a/src/tribler-core/tribler_core/components/watch_folder/watch_folder_component.py +++ b/src/tribler/core/components/watch_folder/watch_folder_component.py @@ -1,6 +1,6 @@ -from tribler_core.components.base import Component -from tribler_core.components.libtorrent.libtorrent_component import LibtorrentComponent -from tribler_core.components.watch_folder.watch_folder import WatchFolder +from tribler.core.components.base import Component +from tribler.core.components.libtorrent.libtorrent_component import LibtorrentComponent +from tribler.core.components.watch_folder.watch_folder import WatchFolder class WatchFolderComponent(Component): diff --git a/src/tribler-core/tribler_core/config/__init__.py b/src/tribler/core/config/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/config/__init__.py rename to src/tribler/core/config/__init__.py diff --git a/src/tribler-core/tribler_core/logger/__init__.py b/src/tribler/core/config/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/logger/__init__.py rename to src/tribler/core/config/tests/__init__.py diff --git a/src/tribler-core/tribler_core/config/tests/test_tribler_config.py b/src/tribler/core/config/tests/test_tribler_config.py similarity index 95% rename from src/tribler-core/tribler_core/config/tests/test_tribler_config.py rename to src/tribler/core/config/tests/test_tribler_config.py index c64e5dd3139..2639b2e70c6 100644 --- a/src/tribler-core/tribler_core/config/tests/test_tribler_config.py +++ b/src/tribler/core/config/tests/test_tribler_config.py @@ -4,9 +4,9 @@ import pytest -from tribler_core.config.tribler_config import TriblerConfig -from tribler_core.tests.tools.common import TESTS_DATA_DIR -from tribler_core.utilities.path_util import Path +from tribler.core.config.tribler_config import TriblerConfig +from tribler.core.tests.tools.common import TESTS_DATA_DIR +from tribler.core.utilities.path_util import Path CONFIG_PATH = TESTS_DATA_DIR / "config_files" diff --git a/src/tribler-core/tribler_core/config/tests/test_tribler_config_section.py b/src/tribler/core/config/tests/test_tribler_config_section.py similarity index 94% rename from src/tribler-core/tribler_core/config/tests/test_tribler_config_section.py rename to src/tribler/core/config/tests/test_tribler_config_section.py index 2bf1517c4b5..b3b65698205 100644 --- a/src/tribler-core/tribler_core/config/tests/test_tribler_config_section.py +++ b/src/tribler/core/config/tests/test_tribler_config_section.py @@ -3,7 +3,7 @@ import pytest -from tribler_core.config.tribler_config_section import TriblerConfigSection +from tribler.core.config.tribler_config_section import TriblerConfigSection class TriblerTestConfigSection(TriblerConfigSection): diff --git a/src/tribler-core/tribler_core/config/tribler_config.py b/src/tribler/core/config/tribler_config.py similarity index 98% rename from src/tribler-core/tribler_core/config/tribler_config.py rename to src/tribler/core/config/tribler_config.py index 6b0c4a97c32..04e2a0beaff 100644 --- a/src/tribler-core/tribler_core/config/tribler_config.py +++ b/src/tribler/core/config/tribler_config.py @@ -10,7 +10,7 @@ from pydantic import PrivateAttr -from tribler_core.config.tribler_config_sections import TriblerConfigSections +from tribler.core.config.tribler_config_sections import TriblerConfigSections logger = logging.getLogger('Tribler Config') diff --git a/src/tribler-core/tribler_core/config/tribler_config_section.py b/src/tribler/core/config/tribler_config_section.py similarity index 100% rename from src/tribler-core/tribler_core/config/tribler_config_section.py rename to src/tribler/core/config/tribler_config_section.py diff --git a/src/tribler-core/tribler_core/config/tribler_config_sections.py b/src/tribler/core/config/tribler_config_sections.py similarity index 67% rename from src/tribler-core/tribler_core/config/tribler_config_sections.py rename to src/tribler/core/config/tribler_config_sections.py index 1480c14f1ea..1a2dc580c80 100644 --- a/src/tribler-core/tribler_core/config/tribler_config_sections.py +++ b/src/tribler/core/config/tribler_config_sections.py @@ -1,23 +1,23 @@ from pydantic import BaseSettings, Extra -from tribler_core.components.bandwidth_accounting.settings import BandwidthAccountingSettings -from tribler_core.components.gigachannel.community.settings import ChantSettings -from tribler_core.components.ipv8.settings import ( +from tribler.core.components.bandwidth_accounting.settings import BandwidthAccountingSettings +from tribler.core.components.gigachannel.community.settings import ChantSettings +from tribler.core.components.ipv8.settings import ( BootstrapSettings, DHTSettings, DiscoveryCommunitySettings, Ipv8Settings, ) -from tribler_core.components.key.settings import TrustchainSettings -from tribler_core.components.libtorrent.settings import DownloadDefaultsSettings, LibtorrentSettings -from tribler_core.components.metadata_store.remote_query_community.settings import RemoteQueryCommunitySettings -from tribler_core.components.popularity.settings import PopularityCommunitySettings -from tribler_core.components.resource_monitor.settings import ResourceMonitorSettings -from tribler_core.components.restapi.rest.settings import APISettings -from tribler_core.components.torrent_checker.settings import TorrentCheckerSettings -from tribler_core.components.tunnel.settings import TunnelCommunitySettings -from tribler_core.components.watch_folder.settings import WatchFolderSettings -from tribler_core.settings import GeneralSettings +from tribler.core.components.key.settings import TrustchainSettings +from tribler.core.components.libtorrent.settings import DownloadDefaultsSettings, LibtorrentSettings +from tribler.core.components.metadata_store.remote_query_community.settings import RemoteQueryCommunitySettings +from tribler.core.components.popularity.settings import PopularityCommunitySettings +from tribler.core.components.resource_monitor.settings import ResourceMonitorSettings +from tribler.core.components.restapi.rest.settings import APISettings +from tribler.core.components.torrent_checker.settings import TorrentCheckerSettings +from tribler.core.components.tunnel.settings import TunnelCommunitySettings +from tribler.core.components.watch_folder.settings import WatchFolderSettings +from tribler.core.settings import GeneralSettings class TriblerConfigSections(BaseSettings): diff --git a/src/tribler-core/tribler_core/conftest.py b/src/tribler/core/conftest.py similarity index 91% rename from src/tribler-core/tribler_core/conftest.py rename to src/tribler/core/conftest.py index 1e6cfc4bbdf..3ff8f0630ce 100644 --- a/src/tribler-core/tribler_core/conftest.py +++ b/src/tribler/core/conftest.py @@ -12,19 +12,19 @@ import pytest -from tribler_core.components.libtorrent.download_manager.download import Download -from tribler_core.components.libtorrent.download_manager.download_config import DownloadConfig -from tribler_core.components.libtorrent.download_manager.download_manager import DownloadManager -from tribler_core.components.libtorrent.settings import LibtorrentSettings -from tribler_core.components.libtorrent.torrentdef import TorrentDef -from tribler_core.components.metadata_store.db.store import MetadataStore -from tribler_core.components.tag.db.tag_db import TagDatabase -from tribler_core.config.tribler_config import TriblerConfig -from tribler_core.tests.tools.common import TESTS_DATA_DIR, TESTS_DIR -from tribler_core.tests.tools.tracker.udp_tracker import UDPTracker -from tribler_core.utilities.network_utils import default_network_utils -from tribler_core.utilities.simpledefs import DLSTATUS_SEEDING -from tribler_core.utilities.unicode import hexlify +from tribler.core.components.libtorrent.download_manager.download import Download +from tribler.core.components.libtorrent.download_manager.download_config import DownloadConfig +from tribler.core.components.libtorrent.download_manager.download_manager import DownloadManager +from tribler.core.components.libtorrent.settings import LibtorrentSettings +from tribler.core.components.libtorrent.torrentdef import TorrentDef +from tribler.core.components.metadata_store.db.store import MetadataStore +from tribler.core.components.tag.db.tag_db import TagDatabase +from tribler.core.config.tribler_config import TriblerConfig +from tribler.core.tests.tools.common import TESTS_DATA_DIR, TESTS_DIR +from tribler.core.tests.tools.tracker.udp_tracker import UDPTracker +from tribler.core.utilities.network_utils import default_network_utils +from tribler.core.utilities.simpledefs import DLSTATUS_SEEDING +from tribler.core.utilities.unicode import hexlify # Enable origin tracking for coroutine objects in the current thread, so when a test does not handle diff --git a/src/tribler-core/tribler_core/exceptions.py b/src/tribler/core/exceptions.py similarity index 100% rename from src/tribler-core/tribler_core/exceptions.py rename to src/tribler/core/exceptions.py diff --git a/src/tribler-core/tribler_core/logger/tests/__init__.py b/src/tribler/core/logger/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/logger/tests/__init__.py rename to src/tribler/core/logger/__init__.py diff --git a/src/tribler-core/tribler_core/logger/logger.py b/src/tribler/core/logger/logger.py similarity index 98% rename from src/tribler-core/tribler_core/logger/logger.py rename to src/tribler/core/logger/logger.py index 417f50b9d99..a6f66cabe95 100644 --- a/src/tribler-core/tribler_core/logger/logger.py +++ b/src/tribler/core/logger/logger.py @@ -30,7 +30,7 @@ def get_logger_config_path(): if not hasattr(sys, '_MEIPASS'): dirname = Path(__file__).absolute().parent else: - dirname = Path(getattr(sys, '_MEIPASS')) / "tribler_source/tribler_core/logger" + dirname = Path(getattr(sys, '_MEIPASS')) / "tribler_source/tribler/core/logger" return dirname / LOG_CONFIG_FILENAME diff --git a/src/tribler-core/tribler_core/logger/logger.yaml b/src/tribler/core/logger/logger.yaml similarity index 89% rename from src/tribler-core/tribler_core/logger/logger.yaml rename to src/tribler/core/logger/logger.yaml index 53acc5a2321..d8edbdf4fce 100644 --- a/src/tribler-core/tribler_core/logger/logger.yaml +++ b/src/tribler/core/logger/logger.yaml @@ -1,10 +1,8 @@ -# File: tribler_core/logger.yaml - version: 1 disable_existing_loggers: false filters: stdout_filter: - () : tribler_core.logger.logger.StdoutFilter + () : tribler.core.logger.logger.StdoutFilter # Logging formatter formatters: @@ -50,13 +48,13 @@ handlers: level: INFO formatter: standard filters: [stdout_filter] - stream: ext://tribler_core.logger.logger_streams.stdout_wrapper + stream: ext://tribler.core.logger.logger_streams.stdout_wrapper stderr_handler: class: logging.StreamHandler level: ERROR formatter: error - stream: ext://tribler_core.logger.logger_streams.stderr_wrapper + stream: ext://tribler.core.logger.logger_streams.stderr_wrapper # Root Logger Configuration root: diff --git a/src/tribler-core/tribler_core/logger/logger_streams.py b/src/tribler/core/logger/logger_streams.py similarity index 100% rename from src/tribler-core/tribler_core/logger/logger_streams.py rename to src/tribler/core/logger/logger_streams.py diff --git a/src/tribler-core/tribler_core/sentry_reporter/__init__.py b/src/tribler/core/logger/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/sentry_reporter/__init__.py rename to src/tribler/core/logger/tests/__init__.py diff --git a/src/tribler-core/tribler_core/logger/tests/test_logger.py b/src/tribler/core/logger/tests/test_logger.py similarity index 91% rename from src/tribler-core/tribler_core/logger/tests/test_logger.py rename to src/tribler/core/logger/tests/test_logger.py index 1141de7df10..95b0ff39c83 100644 --- a/src/tribler-core/tribler_core/logger/tests/test_logger.py +++ b/src/tribler/core/logger/tests/test_logger.py @@ -2,11 +2,12 @@ from io import BytesIO, TextIOWrapper from unittest.mock import MagicMock, Mock, call, patch -from tribler_core.logger.logger import get_logger_config_path, setup_logging -from tribler_core.logger.logger_streams import StreamWrapper +from tribler.core.utilities.path_util import Path +from tribler.core.logger.logger import get_logger_config_path, setup_logging +from tribler.core.logger.logger_streams import StreamWrapper -@patch('tribler_core.logger.logger.__file__', '/a/b/c/logger.py') +@patch('tribler.core.logger.logger.__file__', '/a/b/c/logger.py') def test_get_logger_config_path(): config_path = get_logger_config_path() # take the last part of the path to ignore a drive name on Windows @@ -14,10 +15,10 @@ def test_get_logger_config_path(): with patch('sys._MEIPASS', '/x/y/z/', create=True): config_path = get_logger_config_path() - assert config_path.parts[-7:] == ('x', 'y', 'z', 'tribler_source', 'tribler_core', 'logger', 'logger.yaml') + assert config_path == Path('/x/y/z/tribler_source/tribler/core/logger/logger.yaml') -@patch('tribler_core.logger.logger.logger') +@patch('tribler.core.logger.logger.logger') @patch('sys.stdout') @patch('sys.stderr') @patch('builtins.print') @@ -38,7 +39,7 @@ def test_setup_logging_no_config(basic_config: Mock, print_: Mock, stderr: Mock, @patch('yaml.safe_load') @patch('logging.config.dictConfig') -@patch('tribler_core.logger.logger.logger') +@patch('tribler.core.logger.logger.logger') def test_setup_logging(logger: Mock, dict_config: Mock, yaml_safe_load: Mock): log_dir = MagicMock() log_dir.__str__.return_value = '' @@ -66,7 +67,7 @@ def test_setup_logging(logger: Mock, dict_config: Mock, yaml_safe_load: Mock): ) -@patch('tribler_core.logger.logger.logger') +@patch('tribler.core.logger.logger.logger') @patch('sys.stdout') @patch('sys.stderr') @patch('builtins.print') diff --git a/src/tribler-core/tribler_core/notifications.py b/src/tribler/core/notifications.py similarity index 100% rename from src/tribler-core/tribler_core/notifications.py rename to src/tribler/core/notifications.py diff --git a/src/tribler-core/tribler_core/root_certs_mac.pem b/src/tribler/core/root_certs_mac.pem similarity index 100% rename from src/tribler-core/tribler_core/root_certs_mac.pem rename to src/tribler/core/root_certs_mac.pem diff --git a/src/tribler-core/tribler_core/sentry_reporter/tests/__init__.py b/src/tribler/core/sentry_reporter/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/sentry_reporter/tests/__init__.py rename to src/tribler/core/sentry_reporter/__init__.py diff --git a/src/tribler-core/tribler_core/sentry_reporter/sentry_reporter.py b/src/tribler/core/sentry_reporter/sentry_reporter.py similarity index 99% rename from src/tribler-core/tribler_core/sentry_reporter/sentry_reporter.py rename to src/tribler/core/sentry_reporter/sentry_reporter.py index ee0de527f64..2f9f9396847 100644 --- a/src/tribler-core/tribler_core/sentry_reporter/sentry_reporter.py +++ b/src/tribler/core/sentry_reporter/sentry_reporter.py @@ -13,7 +13,7 @@ from sentry_sdk.integrations.logging import LoggingIntegration, ignore_logger from sentry_sdk.integrations.threading import ThreadingIntegration -from tribler_core.sentry_reporter.sentry_tools import ( +from tribler.core.sentry_reporter.sentry_tools import ( delete_item, extract_dict, get_first_item, diff --git a/src/tribler-core/tribler_core/sentry_reporter/sentry_scrubber.py b/src/tribler/core/sentry_reporter/sentry_scrubber.py similarity index 97% rename from src/tribler-core/tribler_core/sentry_reporter/sentry_scrubber.py rename to src/tribler/core/sentry_reporter/sentry_scrubber.py index 417da4b7149..23412a31daf 100644 --- a/src/tribler-core/tribler_core/sentry_reporter/sentry_scrubber.py +++ b/src/tribler/core/sentry_reporter/sentry_scrubber.py @@ -1,11 +1,11 @@ import re -from tribler_core.sentry_reporter.sentry_reporter import ( +from tribler.core.sentry_reporter.sentry_reporter import ( BREADCRUMBS, RELEASE, VALUES, ) -from tribler_core.sentry_reporter.sentry_tools import delete_item, distinct_by, format_version, modify_value +from tribler.core.sentry_reporter.sentry_tools import delete_item, distinct_by, format_version, modify_value class SentryScrubber: diff --git a/src/tribler-core/tribler_core/sentry_reporter/sentry_tools.py b/src/tribler/core/sentry_reporter/sentry_tools.py similarity index 100% rename from src/tribler-core/tribler_core/sentry_reporter/sentry_tools.py rename to src/tribler/core/sentry_reporter/sentry_tools.py diff --git a/src/tribler-core/tribler_core/upgrade/__init__.py b/src/tribler/core/sentry_reporter/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/upgrade/__init__.py rename to src/tribler/core/sentry_reporter/tests/__init__.py diff --git a/src/tribler-core/tribler_core/sentry_reporter/tests/test_sentry_reporter.py b/src/tribler/core/sentry_reporter/tests/test_sentry_reporter.py similarity index 96% rename from src/tribler-core/tribler_core/sentry_reporter/tests/test_sentry_reporter.py rename to src/tribler/core/sentry_reporter/tests/test_sentry_reporter.py index 0f38aa69331..af3ed41e5bc 100644 --- a/src/tribler-core/tribler_core/sentry_reporter/tests/test_sentry_reporter.py +++ b/src/tribler/core/sentry_reporter/tests/test_sentry_reporter.py @@ -2,8 +2,8 @@ import pytest -from tribler_core.utilities.patch_import import patch_import -from tribler_core.sentry_reporter.sentry_reporter import ( +from tribler.core.utilities.patch_import import patch_import +from tribler.core.sentry_reporter.sentry_reporter import ( EXCEPTION, OS_ENVIRON, PLATFORM_DETAILS, @@ -12,7 +12,7 @@ VALUES, this_sentry_strategy, ) -from tribler_core.sentry_reporter.sentry_scrubber import SentryScrubber +from tribler.core.sentry_reporter.sentry_scrubber import SentryScrubber # fmt: off # pylint: disable=redefined-outer-name, protected-access @@ -23,7 +23,7 @@ def sentry_reporter(): return SentryReporter() -@patch('tribler_core.sentry_reporter.sentry_reporter.sentry_sdk.init') +@patch('tribler.core.sentry_reporter.sentry_reporter.sentry_sdk.init') def test_init(mocked_init: Mock, sentry_reporter: SentryReporter): # test that `init` method set all necessary variables and calls `sentry_sdk.init()` sentry_reporter.init(sentry_url='url', release_version='release', scrubber=SentryScrubber(), @@ -33,14 +33,14 @@ def test_init(mocked_init: Mock, sentry_reporter: SentryReporter): mocked_init.assert_called_once() -@patch('tribler_core.sentry_reporter.sentry_reporter.ignore_logger') +@patch('tribler.core.sentry_reporter.sentry_reporter.ignore_logger') def test_ignore_logger(mocked_ignore_logger: Mock, sentry_reporter: SentryReporter): # test that `ignore_logger` calls `ignore_logger` from sentry_sdk sentry_reporter.ignore_logger('logger name') mocked_ignore_logger.assert_called_with('logger name') -@patch('tribler_core.sentry_reporter.sentry_reporter.sentry_sdk.add_breadcrumb') +@patch('tribler.core.sentry_reporter.sentry_reporter.sentry_sdk.add_breadcrumb') def test_add_breadcrumb(mocked_add_breadcrumb: Mock, sentry_reporter: SentryReporter): # test that `add_breadcrumb` passes all necessary arguments to `sentry_sdk` assert sentry_reporter.add_breadcrumb('message', 'category', 'level', named_arg='some') @@ -64,7 +64,7 @@ def test_get_confirmation_no_qt(sentry_reporter: SentryReporter): assert not sentry_reporter.get_confirmation(Exception('test')) -@patch('tribler_core.sentry_reporter.sentry_reporter.sentry_sdk.capture_exception') +@patch('tribler.core.sentry_reporter.sentry_reporter.sentry_sdk.capture_exception') def test_capture_exception(mocked_capture_exception: Mock, sentry_reporter: SentryReporter): # test that `capture_exception` passes an exception to `sentry_sdk` exception = Exception('test') @@ -72,7 +72,7 @@ def test_capture_exception(mocked_capture_exception: Mock, sentry_reporter: Sent mocked_capture_exception.assert_called_with(exception) -@patch('tribler_core.sentry_reporter.sentry_reporter.sentry_sdk.capture_exception') +@patch('tribler.core.sentry_reporter.sentry_reporter.sentry_sdk.capture_exception') def test_event_from_exception(mocked_capture_exception: Mock, sentry_reporter: SentryReporter): # test that `event_from_exception` returns '{}' in case of an empty exception assert sentry_reporter.event_from_exception(None) == {} diff --git a/src/tribler-core/tribler_core/sentry_reporter/tests/test_sentry_scrubber.py b/src/tribler/core/sentry_reporter/tests/test_sentry_scrubber.py similarity index 98% rename from src/tribler-core/tribler_core/sentry_reporter/tests/test_sentry_scrubber.py rename to src/tribler/core/sentry_reporter/tests/test_sentry_scrubber.py index 9aaf69ed291..d3cd2ac718d 100644 --- a/src/tribler-core/tribler_core/sentry_reporter/tests/test_sentry_scrubber.py +++ b/src/tribler/core/sentry_reporter/tests/test_sentry_scrubber.py @@ -1,6 +1,6 @@ import pytest -from tribler_core.sentry_reporter.sentry_reporter import ( +from tribler.core.sentry_reporter.sentry_reporter import ( BREADCRUMBS, CONTEXTS, EXTRA, @@ -11,7 +11,7 @@ SYSINFO, SYS_ARGV, ) -from tribler_core.sentry_reporter.sentry_scrubber import SentryScrubber +from tribler.core.sentry_reporter.sentry_scrubber import SentryScrubber @pytest.fixture(name="scrubber") # this workaround implemented only for pylint diff --git a/src/tribler-core/tribler_core/sentry_reporter/tests/test_sentry_tools.py b/src/tribler/core/sentry_reporter/tests/test_sentry_tools.py similarity index 98% rename from src/tribler-core/tribler_core/sentry_reporter/tests/test_sentry_tools.py rename to src/tribler/core/sentry_reporter/tests/test_sentry_tools.py index fc2db6b9f6b..23fb3809f59 100644 --- a/src/tribler-core/tribler_core/sentry_reporter/tests/test_sentry_tools.py +++ b/src/tribler/core/sentry_reporter/tests/test_sentry_tools.py @@ -1,4 +1,4 @@ -from tribler_core.sentry_reporter.sentry_tools import ( +from tribler.core.sentry_reporter.sentry_tools import ( delete_item, distinct_by, extract_dict, diff --git a/src/tribler-core/tribler_core/settings.py b/src/tribler/core/settings.py similarity index 78% rename from src/tribler-core/tribler_core/settings.py rename to src/tribler/core/settings.py index ab24a649660..98415e49ff3 100644 --- a/src/tribler-core/tribler_core/settings.py +++ b/src/tribler/core/settings.py @@ -1,6 +1,6 @@ from pydantic import Field -from tribler_core.config.tribler_config_section import TriblerConfigSection +from tribler.core.config.tribler_config_section import TriblerConfigSection class GeneralSettings(TriblerConfigSection): diff --git a/src/tribler-core/tribler_core/setup.py b/src/tribler/core/setup.py similarity index 89% rename from src/tribler-core/tribler_core/setup.py rename to src/tribler/core/setup.py index 7968f176eb6..4b87eb06603 100644 --- a/src/tribler-core/tribler_core/setup.py +++ b/src/tribler/core/setup.py @@ -1,5 +1,5 @@ -from tribler_core.setuptools import find_packages, setup -from tribler_core.version import version_id +from tribler.core.setuptools import find_packages, setup +from tribler.core.version import version_id with open('README.rst') as f: long_description = f.read() diff --git a/src/tribler-core/tribler_core/start_core.py b/src/tribler/core/start_core.py similarity index 79% rename from src/tribler-core/tribler_core/start_core.py rename to src/tribler/core/start_core.py index 32947dc0785..592ff62895b 100644 --- a/src/tribler-core/tribler_core/start_core.py +++ b/src/tribler/core/start_core.py @@ -6,37 +6,37 @@ import sys from typing import List -from tribler_core import notifications -from tribler_core.check_os import ( +from tribler.core import notifications +from tribler.core.check_os import ( check_and_enable_code_tracing, set_process_priority, should_kill_other_tribler_instances, ) -from tribler_core.components.bandwidth_accounting.bandwidth_accounting_component import BandwidthAccountingComponent -from tribler_core.components.base import Component, Session -from tribler_core.components.gigachannel.gigachannel_component import GigaChannelComponent -from tribler_core.components.gigachannel_manager.gigachannel_manager_component import GigachannelManagerComponent -from tribler_core.components.ipv8.ipv8_component import Ipv8Component -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.components.libtorrent.libtorrent_component import LibtorrentComponent -from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent -from tribler_core.components.payout.payout_component import PayoutComponent -from tribler_core.components.popularity.popularity_component import PopularityComponent -from tribler_core.components.reporter.exception_handler import default_core_exception_handler -from tribler_core.components.reporter.reporter_component import ReporterComponent -from tribler_core.components.resource_monitor.resource_monitor_component import ResourceMonitorComponent -from tribler_core.components.restapi.restapi_component import RESTComponent -from tribler_core.components.socks_servers.socks_servers_component import SocksServersComponent -from tribler_core.components.tag.tag_component import TagComponent -from tribler_core.components.torrent_checker.torrent_checker_component import TorrentCheckerComponent -from tribler_core.components.tunnel.tunnel_component import TunnelsComponent -from tribler_core.components.version_check.version_check_component import VersionCheckComponent -from tribler_core.components.watch_folder.watch_folder_component import WatchFolderComponent -from tribler_core.config.tribler_config import TriblerConfig -from tribler_core.logger.logger import load_logger_config -from tribler_core.sentry_reporter.sentry_reporter import SentryReporter, SentryStrategy -from tribler_core.upgrade.version_manager import VersionHistory -from tribler_core.utilities.process_checker import ProcessChecker +from tribler.core.components.bandwidth_accounting.bandwidth_accounting_component import BandwidthAccountingComponent +from tribler.core.components.base import Component, Session +from tribler.core.components.gigachannel.gigachannel_component import GigaChannelComponent +from tribler.core.components.gigachannel_manager.gigachannel_manager_component import GigachannelManagerComponent +from tribler.core.components.ipv8.ipv8_component import Ipv8Component +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.components.libtorrent.libtorrent_component import LibtorrentComponent +from tribler.core.components.metadata_store.metadata_store_component import MetadataStoreComponent +from tribler.core.components.payout.payout_component import PayoutComponent +from tribler.core.components.popularity.popularity_component import PopularityComponent +from tribler.core.components.reporter.exception_handler import default_core_exception_handler +from tribler.core.components.reporter.reporter_component import ReporterComponent +from tribler.core.components.resource_monitor.resource_monitor_component import ResourceMonitorComponent +from tribler.core.components.restapi.restapi_component import RESTComponent +from tribler.core.components.socks_servers.socks_servers_component import SocksServersComponent +from tribler.core.components.tag.tag_component import TagComponent +from tribler.core.components.torrent_checker.torrent_checker_component import TorrentCheckerComponent +from tribler.core.components.tunnel.tunnel_component import TunnelsComponent +from tribler.core.components.version_check.version_check_component import VersionCheckComponent +from tribler.core.components.watch_folder.watch_folder_component import WatchFolderComponent +from tribler.core.config.tribler_config import TriblerConfig +from tribler.core.logger.logger import load_logger_config +from tribler.core.sentry_reporter.sentry_reporter import SentryReporter, SentryStrategy +from tribler.core.upgrade.version_manager import VersionHistory +from tribler.core.utilities.process_checker import ProcessChecker logger = logging.getLogger(__name__) CONFIG_FILE_NAME = 'triblerd.conf' diff --git a/src/tribler-core/tribler_core/tests/test_check_os.py b/src/tribler/core/tests/test_check_os.py similarity index 78% rename from src/tribler-core/tribler_core/tests/test_check_os.py rename to src/tribler/core/tests/test_check_os.py index 9752b4a390d..1d7dcd508fe 100644 --- a/src/tribler-core/tribler_core/tests/test_check_os.py +++ b/src/tribler/core/tests/test_check_os.py @@ -5,8 +5,8 @@ import pytest -from tribler_core.check_os import enable_fault_handler, error_and_exit, should_kill_other_tribler_instances -from tribler_core.utilities.patch_import import patch_import +from tribler.core.check_os import enable_fault_handler, error_and_exit, should_kill_other_tribler_instances +from tribler.core.utilities.patch_import import patch_import # pylint: disable=import-outside-toplevel # fmt: off @@ -15,7 +15,7 @@ @patch('sys.exit') -@patch('tribler_core.check_os.show_system_popup') +@patch('tribler.core.check_os.show_system_popup') async def test_error_and_exit(mocked_show_system_popup, mocked_sys_exit): error_and_exit('title', 'text') mocked_show_system_popup.assert_called_once_with('title', 'text') @@ -23,7 +23,7 @@ async def test_error_and_exit(mocked_show_system_popup, mocked_sys_exit): @patch_import(['faulthandler'], strict=True, enable=MagicMock()) -@patch('tribler_core.check_os.open', new=MagicMock()) +@patch('tribler.core.check_os.open', new=MagicMock()) async def test_enable_fault_handler(): import faulthandler enable_fault_handler(log_dir=MagicMock()) @@ -32,14 +32,14 @@ async def test_enable_fault_handler(): @patch_import(['faulthandler'], strict=True, always_raise_exception_on_import=True) @patch.object(Logger, 'error') -@patch('tribler_core.check_os.open', new=MagicMock()) +@patch('tribler.core.check_os.open', new=MagicMock()) async def test_enable_fault_handler_import_error(mocked_log_error: MagicMock): enable_fault_handler(log_dir=MagicMock()) mocked_log_error.assert_called_once() @patch_import(['faulthandler'], strict=True, enable=MagicMock()) -@patch('tribler_core.check_os.open', new=MagicMock()) +@patch('tribler.core.check_os.open', new=MagicMock()) async def test_enable_fault_handler_log_dir_not_exists(): log_dir = MagicMock(exists=MagicMock(return_value=False), mkdir=MagicMock()) @@ -48,9 +48,9 @@ async def test_enable_fault_handler_log_dir_not_exists(): log_dir.mkdir.assert_called_once() -@patch('tribler_core.check_os.logger.info') +@patch('tribler.core.check_os.logger.info') @patch('sys.argv', []) -@patch('tribler_core.check_os.get_existing_tribler_pid', MagicMock(return_value=100)) +@patch('tribler.core.check_os.get_existing_tribler_pid', MagicMock(return_value=100)) @patch('os.getpid', MagicMock(return_value=200)) @patch('psutil.Process', MagicMock(return_value=MagicMock(status=MagicMock(side_effect=psutil.NoSuchProcess(100))))) def test_should_kill_other_tribler_instances_process_not_found( @@ -61,13 +61,13 @@ def test_should_kill_other_tribler_instances_process_not_found( mocked_logger_info.assert_called_with('Old process not found') -@patch('tribler_core.check_os.logger.info') +@patch('tribler.core.check_os.logger.info') @patch('sys.argv', []) -@patch('tribler_core.check_os.get_existing_tribler_pid', MagicMock(return_value=100)) +@patch('tribler.core.check_os.get_existing_tribler_pid', MagicMock(return_value=100)) @patch('os.getpid', MagicMock(return_value=200)) @patch('psutil.Process', MagicMock(return_value=MagicMock(status=MagicMock(return_value=psutil.STATUS_ZOMBIE)))) -@patch('tribler_core.check_os.kill_tribler_process') -@patch('tribler_core.check_os.restart_tribler_properly') +@patch('tribler.core.check_os.kill_tribler_process') +@patch('tribler.core.check_os.restart_tribler_properly') def test_should_kill_other_tribler_instances_zombie( mocked_restart_tribler_properly: MagicMock, mocked_kill_tribler_process: MagicMock, diff --git a/src/tribler-core/tribler_core/tests/test_configparser.py b/src/tribler/core/tests/test_configparser.py similarity index 92% rename from src/tribler-core/tribler_core/tests/test_configparser.py rename to src/tribler/core/tests/test_configparser.py index f75b01989a6..3ad11c5c101 100644 --- a/src/tribler-core/tribler_core/tests/test_configparser.py +++ b/src/tribler/core/tests/test_configparser.py @@ -2,9 +2,9 @@ import pytest -from tribler_core.exceptions import OperationNotPossibleAtRuntimeException -from tribler_core.utilities.configparser import CallbackConfigParser -from tribler_core.utilities.install_dir import get_lib_path +from tribler.core.exceptions import OperationNotPossibleAtRuntimeException +from tribler.core.utilities.configparser import CallbackConfigParser +from tribler.core.utilities.install_dir import get_lib_path CONFIG_FILES_DIR = get_lib_path() / "tests/tools/data/config_files/" diff --git a/src/tribler-core/tribler_core/tests/test_search_utils.py b/src/tribler/core/tests/test_search_utils.py similarity index 87% rename from src/tribler-core/tribler_core/tests/test_search_utils.py rename to src/tribler/core/tests/test_search_utils.py index 4801190ff08..0506d136f57 100644 --- a/src/tribler-core/tribler_core/tests/test_search_utils.py +++ b/src/tribler/core/tests/test_search_utils.py @@ -1,4 +1,4 @@ -from tribler_core.utilities.search_utils import filter_keywords, split_into_keywords +from tribler.core.utilities.search_utils import filter_keywords, split_into_keywords def test_split_into_keywords(): diff --git a/src/tribler/core/tests/test_start_core.py b/src/tribler/core/tests/test_start_core.py new file mode 100644 index 00000000000..784141be745 --- /dev/null +++ b/src/tribler/core/tests/test_start_core.py @@ -0,0 +1,19 @@ +from unittest.mock import MagicMock, patch + +from tribler.core.start_core import run_tribler_core_session +from tribler.core.utilities.path_util import Path + +# pylint: disable= +# fmt: off + + +@patch('tribler.core.logger.logger.load_logger_config', new=MagicMock()) +@patch('tribler.core.start_core.set_process_priority', new=MagicMock()) +@patch('tribler.core.start_core.check_and_enable_code_tracing', new=MagicMock()) +@patch('asyncio.get_event_loop', new=MagicMock()) +@patch('tribler.core.start_core.TriblerConfig.load', new=MagicMock()) +@patch('tribler.core.start_core.core_session') +def test_start_tribler_core_no_exceptions(mocked_core_session): + # test that base logic of tribler core runs without exceptions + run_tribler_core_session(1, 'key', Path('.'), False) + mocked_core_session.assert_called_once() diff --git a/src/tribler-core/tribler_core/tests/tools/base_test.py b/src/tribler/core/tests/tools/base_test.py similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/base_test.py rename to src/tribler/core/tests/tools/base_test.py diff --git a/src/tribler-core/tribler_core/tests/tools/common.py b/src/tribler/core/tests/tools/common.py similarity index 90% rename from src/tribler-core/tribler_core/tests/tools/common.py rename to src/tribler/core/tests/tools/common.py index e44da6b2c71..8d6add28610 100644 --- a/src/tribler-core/tribler_core/tests/tools/common.py +++ b/src/tribler/core/tests/tools/common.py @@ -1,6 +1,6 @@ import binascii -from tribler_core.utilities.path_util import Path +from tribler.core.utilities.path_util import Path UBUNTU_1504_INFOHASH = binascii.unhexlify('FC8A15A2FAF2734DBB1DC5F7AFDC5C9BEAEB1F59') diff --git a/src/tribler-core/tribler_core/tests/tools/data/41aea20908363a80d44234e8fef07fab506cd3b4.torrent b/src/tribler/core/tests/tools/data/41aea20908363a80d44234e8fef07fab506cd3b4.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/41aea20908363a80d44234e8fef07fab506cd3b4.torrent rename to src/tribler/core/tests/tools/data/41aea20908363a80d44234e8fef07fab506cd3b4.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/41aea20908363a80d44234e8fef07fab506cd3b4/Potentiometer_100K_ohm.jpeg b/src/tribler/core/tests/tools/data/41aea20908363a80d44234e8fef07fab506cd3b4/Potentiometer_100K_ohm.jpeg similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/41aea20908363a80d44234e8fef07fab506cd3b4/Potentiometer_100K_ohm.jpeg rename to src/tribler/core/tests/tools/data/41aea20908363a80d44234e8fef07fab506cd3b4/Potentiometer_100K_ohm.jpeg diff --git a/src/tribler-core/tribler_core/tests/tools/data/45a647b1120ed9fe7f793e17585efb4b0efdf1a5.torrent b/src/tribler/core/tests/tools/data/45a647b1120ed9fe7f793e17585efb4b0efdf1a5.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/45a647b1120ed9fe7f793e17585efb4b0efdf1a5.torrent rename to src/tribler/core/tests/tools/data/45a647b1120ed9fe7f793e17585efb4b0efdf1a5.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/Night.Of.The.Living.Dead_1080p_archive.torrent b/src/tribler/core/tests/tools/data/Night.Of.The.Living.Dead_1080p_archive.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/Night.Of.The.Living.Dead_1080p_archive.torrent rename to src/tribler/core/tests/tools/data/Night.Of.The.Living.Dead_1080p_archive.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/Pioneer.One.S01E01.REDUX.720p.x264-VODO.torrent b/src/tribler/core/tests/tools/data/Pioneer.One.S01E01.REDUX.720p.x264-VODO.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/Pioneer.One.S01E01.REDUX.720p.x264-VODO.torrent rename to src/tribler/core/tests/tools/data/Pioneer.One.S01E01.REDUX.720p.x264-VODO.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/Pioneer.One.S01E06.720p.x264-VODO.torrent b/src/tribler/core/tests/tools/data/Pioneer.One.S01E06.720p.x264-VODO.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/Pioneer.One.S01E06.720p.x264-VODO.torrent rename to src/tribler/core/tests/tools/data/Pioneer.One.S01E06.720p.x264-VODO.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/bad.mdblob b/src/tribler/core/tests/tools/data/bad.mdblob similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/bad.mdblob rename to src/tribler/core/tests/tools/data/bad.mdblob diff --git a/src/tribler-core/tribler_core/tests/tools/data/bak_single.torrent b/src/tribler/core/tests/tools/data/bak_single.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/bak_single.torrent rename to src/tribler/core/tests/tools/data/bak_single.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/bootstrap_empty.txt b/src/tribler/core/tests/tools/data/bootstrap_empty.txt similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/bootstrap_empty.txt rename to src/tribler/core/tests/tools/data/bootstrap_empty.txt diff --git a/src/tribler-core/tribler_core/tests/tools/data/btc_wallet b/src/tribler/core/tests/tools/data/btc_wallet similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/btc_wallet rename to src/tribler/core/tests/tools/data/btc_wallet diff --git a/src/tribler-core/tribler_core/tests/tools/data/certfile.pem b/src/tribler/core/tests/tools/data/certfile.pem similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/certfile.pem rename to src/tribler/core/tests/tools/data/certfile.pem diff --git a/src/tribler-core/tribler_core/tests/tools/data/channel.mdblob b/src/tribler/core/tests/tools/data/channel.mdblob similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/channel.mdblob rename to src/tribler/core/tests/tools/data/channel.mdblob diff --git a/src/tribler-core/tribler_core/tests/tools/data/config_files/13a25451c761b1482d3e85432f07c4be05ca8a56.conf b/src/tribler/core/tests/tools/data/config_files/13a25451c761b1482d3e85432f07c4be05ca8a56.conf similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/config_files/13a25451c761b1482d3e85432f07c4be05ca8a56.conf rename to src/tribler/core/tests/tools/data/config_files/13a25451c761b1482d3e85432f07c4be05ca8a56.conf diff --git a/src/tribler-core/tribler_core/tests/tools/data/config_files/194257a7bf4eaea978f4b5b7fbd3b4efcdd99e43.state b/src/tribler/core/tests/tools/data/config_files/194257a7bf4eaea978f4b5b7fbd3b4efcdd99e43.state similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/config_files/194257a7bf4eaea978f4b5b7fbd3b4efcdd99e43.state rename to src/tribler/core/tests/tools/data/config_files/194257a7bf4eaea978f4b5b7fbd3b4efcdd99e43.state diff --git a/src/tribler-core/tribler_core/tests/tools/data/config_files/194257a7bf4eaea978f4b5b7fbd3b4efcdd99e43_corrupted.state b/src/tribler/core/tests/tools/data/config_files/194257a7bf4eaea978f4b5b7fbd3b4efcdd99e43_corrupted.state similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/config_files/194257a7bf4eaea978f4b5b7fbd3b4efcdd99e43_corrupted.state rename to src/tribler/core/tests/tools/data/config_files/194257a7bf4eaea978f4b5b7fbd3b4efcdd99e43_corrupted.state diff --git a/src/tribler-core/tribler_core/tests/tools/data/config_files/config1.conf b/src/tribler/core/tests/tools/data/config_files/config1.conf similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/config_files/config1.conf rename to src/tribler/core/tests/tools/data/config_files/config1.conf diff --git a/src/tribler-core/tribler_core/tests/tools/data/config_files/corrupt-triblerd.conf b/src/tribler/core/tests/tools/data/config_files/corrupt-triblerd.conf similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/config_files/corrupt-triblerd.conf rename to src/tribler/core/tests/tools/data/config_files/corrupt-triblerd.conf diff --git a/src/tribler-core/tribler_core/tests/tools/data/config_files/corrupt_download_config.conf b/src/tribler/core/tests/tools/data/config_files/corrupt_download_config.conf similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/config_files/corrupt_download_config.conf rename to src/tribler/core/tests/tools/data/config_files/corrupt_download_config.conf diff --git a/src/tribler-core/tribler_core/tests/tools/data/config_files/corrupt_session_config.conf b/src/tribler/core/tests/tools/data/config_files/corrupt_session_config.conf similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/config_files/corrupt_session_config.conf rename to src/tribler/core/tests/tools/data/config_files/corrupt_session_config.conf diff --git a/src/tribler-core/tribler_core/tests/tools/data/config_files/missed_state.conf b/src/tribler/core/tests/tools/data/config_files/missed_state.conf similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/config_files/missed_state.conf rename to src/tribler/core/tests/tools/data/config_files/missed_state.conf diff --git a/src/tribler-core/tribler_core/tests/tools/data/config_files/triblerd75.conf b/src/tribler/core/tests/tools/data/config_files/triblerd75.conf similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/config_files/triblerd75.conf rename to src/tribler/core/tests/tools/data/config_files/triblerd75.conf diff --git a/src/tribler-core/tribler_core/tests/tools/data/contentdir/file.txt b/src/tribler/core/tests/tools/data/contentdir/file.txt similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/contentdir/file.txt rename to src/tribler/core/tests/tools/data/contentdir/file.txt diff --git a/src/tribler-core/tribler_core/tests/tools/data/contentdir/otherfile.txt b/src/tribler/core/tests/tools/data/contentdir/otherfile.txt similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/contentdir/otherfile.txt rename to src/tribler/core/tests/tools/data/contentdir/otherfile.txt diff --git a/src/tribler-core/tribler_core/tests/tools/data/delete.mdblob b/src/tribler/core/tests/tools/data/delete.mdblob similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/delete.mdblob rename to src/tribler/core/tests/tools/data/delete.mdblob diff --git a/src/tribler-core/tribler_core/tests/tools/data/libtorrent/corrupt_torrent.torrent b/src/tribler/core/tests/tools/data/libtorrent/corrupt_torrent.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/libtorrent/corrupt_torrent.torrent rename to src/tribler/core/tests/tools/data/libtorrent/corrupt_torrent.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/libtorrent/lt.state b/src/tribler/core/tests/tools/data/libtorrent/lt.state similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/libtorrent/lt.state rename to src/tribler/core/tests/tools/data/libtorrent/lt.state diff --git a/src/tribler-core/tribler_core/tests/tools/data/linux_torrents/debian-9.4.0-amd64-DVD-1.iso.torrent b/src/tribler/core/tests/tools/data/linux_torrents/debian-9.4.0-amd64-DVD-1.iso.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/linux_torrents/debian-9.4.0-amd64-DVD-1.iso.torrent rename to src/tribler/core/tests/tools/data/linux_torrents/debian-9.4.0-amd64-DVD-1.iso.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/linux_torrents/debian-9.4.0-amd64-DVD-2.iso.torrent b/src/tribler/core/tests/tools/data/linux_torrents/debian-9.4.0-amd64-DVD-2.iso.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/linux_torrents/debian-9.4.0-amd64-DVD-2.iso.torrent rename to src/tribler/core/tests/tools/data/linux_torrents/debian-9.4.0-amd64-DVD-2.iso.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/linux_torrents/debian-9.4.0-amd64-DVD-3.iso.torrent b/src/tribler/core/tests/tools/data/linux_torrents/debian-9.4.0-amd64-DVD-3.iso.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/linux_torrents/debian-9.4.0-amd64-DVD-3.iso.torrent rename to src/tribler/core/tests/tools/data/linux_torrents/debian-9.4.0-amd64-DVD-3.iso.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/linux_torrents/debian-9.4.0-amd64-netinst.iso.torrent b/src/tribler/core/tests/tools/data/linux_torrents/debian-9.4.0-amd64-netinst.iso.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/linux_torrents/debian-9.4.0-amd64-netinst.iso.torrent rename to src/tribler/core/tests/tools/data/linux_torrents/debian-9.4.0-amd64-netinst.iso.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/linux_torrents/debian-9.4.0-amd64-xfce-CD-1.iso.torrent b/src/tribler/core/tests/tools/data/linux_torrents/debian-9.4.0-amd64-xfce-CD-1.iso.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/linux_torrents/debian-9.4.0-amd64-xfce-CD-1.iso.torrent rename to src/tribler/core/tests/tools/data/linux_torrents/debian-9.4.0-amd64-xfce-CD-1.iso.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/linux_torrents/debian-mac-9.4.0-amd64-netinst.iso.torrent b/src/tribler/core/tests/tools/data/linux_torrents/debian-mac-9.4.0-amd64-netinst.iso.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/linux_torrents/debian-mac-9.4.0-amd64-netinst.iso.torrent rename to src/tribler/core/tests/tools/data/linux_torrents/debian-mac-9.4.0-amd64-netinst.iso.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/linux_torrents/nested_dir/corrupt_torrent.torrent b/src/tribler/core/tests/tools/data/linux_torrents/nested_dir/corrupt_torrent.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/linux_torrents/nested_dir/corrupt_torrent.torrent rename to src/tribler/core/tests/tools/data/linux_torrents/nested_dir/corrupt_torrent.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/linux_torrents/nested_dir/ubuntu-15.04-desktop-amd64.iso.torrent b/src/tribler/core/tests/tools/data/linux_torrents/nested_dir/ubuntu-15.04-desktop-amd64.iso.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/linux_torrents/nested_dir/ubuntu-15.04-desktop-amd64.iso.torrent rename to src/tribler/core/tests/tools/data/linux_torrents/nested_dir/ubuntu-15.04-desktop-amd64.iso.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/linux_torrents/ubuntu-17.10-server-arm64.iso.torrent b/src/tribler/core/tests/tools/data/linux_torrents/ubuntu-17.10-server-arm64.iso.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/linux_torrents/ubuntu-17.10-server-arm64.iso.torrent rename to src/tribler/core/tests/tools/data/linux_torrents/ubuntu-17.10-server-arm64.iso.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/linux_torrents/ubuntu-17.10-server-ppc64el.iso.torrent b/src/tribler/core/tests/tools/data/linux_torrents/ubuntu-17.10-server-ppc64el.iso.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/linux_torrents/ubuntu-17.10-server-ppc64el.iso.torrent rename to src/tribler/core/tests/tools/data/linux_torrents/ubuntu-17.10-server-ppc64el.iso.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/linux_torrents/ubuntu-17.10-server-s390x.iso.torrent b/src/tribler/core/tests/tools/data/linux_torrents/ubuntu-17.10-server-s390x.iso.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/linux_torrents/ubuntu-17.10-server-s390x.iso.torrent rename to src/tribler/core/tests/tools/data/linux_torrents/ubuntu-17.10-server-s390x.iso.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/multi_entries.torrent b/src/tribler/core/tests/tools/data/multi_entries.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/multi_entries.torrent rename to src/tribler/core/tests/tools/data/multi_entries.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7.mdblob b/src/tribler/core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7.mdblob similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7.mdblob rename to src/tribler/core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7.mdblob diff --git a/src/tribler-core/tribler_core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7.torrent b/src/tribler/core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7.torrent rename to src/tribler/core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7/1562337481003.mdblob.lz4 b/src/tribler/core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7/1562337481003.mdblob.lz4 similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7/1562337481003.mdblob.lz4 rename to src/tribler/core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7/1562337481003.mdblob.lz4 diff --git a/src/tribler-core/tribler_core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7400b800d74b575f6.mdblob b/src/tribler/core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7400b800d74b575f6.mdblob similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7400b800d74b575f6.mdblob rename to src/tribler/core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7400b800d74b575f6.mdblob diff --git a/src/tribler-core/tribler_core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7400b800d74b575f6.torrent b/src/tribler/core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7400b800d74b575f6.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7400b800d74b575f6.torrent rename to src/tribler/core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7400b800d74b575f6.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7400b800d74b575f6/1562337581003.mdblob.lz4 b/src/tribler/core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7400b800d74b575f6/1562337581003.mdblob.lz4 similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7400b800d74b575f6/1562337581003.mdblob.lz4 rename to src/tribler/core/tests/tools/data/noncompliant_state_dir/channels/5263ec553e7a062ac4f75eb6f7bf26f7400b800d74b575f6/1562337581003.mdblob.lz4 diff --git a/src/tribler-core/tribler_core/tests/tools/data/noncompliant_state_dir/dlcheckpoints/3efb7e9157110e1a259d3a207403388a67997fd4.state b/src/tribler/core/tests/tools/data/noncompliant_state_dir/dlcheckpoints/3efb7e9157110e1a259d3a207403388a67997fd4.state similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/noncompliant_state_dir/dlcheckpoints/3efb7e9157110e1a259d3a207403388a67997fd4.state rename to src/tribler/core/tests/tools/data/noncompliant_state_dir/dlcheckpoints/3efb7e9157110e1a259d3a207403388a67997fd4.state diff --git a/src/tribler-core/tribler_core/tests/tools/data/noncompliant_state_dir/dlcheckpoints/3efb7e9157110e1a259d3a207403388fffffffff.state b/src/tribler/core/tests/tools/data/noncompliant_state_dir/dlcheckpoints/3efb7e9157110e1a259d3a207403388fffffffff.state similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/noncompliant_state_dir/dlcheckpoints/3efb7e9157110e1a259d3a207403388fffffffff.state rename to src/tribler/core/tests/tools/data/noncompliant_state_dir/dlcheckpoints/3efb7e9157110e1a259d3a207403388fffffffff.state diff --git a/src/tribler-core/tribler_core/tests/tools/data/noncompliant_state_dir/dlcheckpoints/811c1c033474e6a07e42f3f90f3f31dcad7dccc1.state b/src/tribler/core/tests/tools/data/noncompliant_state_dir/dlcheckpoints/811c1c033474e6a07e42f3f90f3f31dcad7dccc1.state similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/noncompliant_state_dir/dlcheckpoints/811c1c033474e6a07e42f3f90f3f31dcad7dccc1.state rename to src/tribler/core/tests/tools/data/noncompliant_state_dir/dlcheckpoints/811c1c033474e6a07e42f3f90f3f31dcad7dccc1.state diff --git a/src/tribler-core/tribler_core/tests/tools/data/private.torrent b/src/tribler/core/tests/tools/data/private.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/private.torrent rename to src/tribler/core/tests/tools/data/private.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/sample_channel/a6c00e0330c332be6ff2f08ccee26dc27750d23a818207f9/1565621688004.mdblob.lz4 b/src/tribler/core/tests/tools/data/sample_channel/a6c00e0330c332be6ff2f08ccee26dc27750d23a818207f9/1565621688004.mdblob.lz4 similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/sample_channel/a6c00e0330c332be6ff2f08ccee26dc27750d23a818207f9/1565621688004.mdblob.lz4 rename to src/tribler/core/tests/tools/data/sample_channel/a6c00e0330c332be6ff2f08ccee26dc27750d23a818207f9/1565621688004.mdblob.lz4 diff --git a/src/tribler-core/tribler_core/tests/tools/data/sample_channel/a6c00e0330c332be6ff2f08ccee26dc27750d23a818207f9/1565621688012.mdblob.lz4 b/src/tribler/core/tests/tools/data/sample_channel/a6c00e0330c332be6ff2f08ccee26dc27750d23a818207f9/1565621688012.mdblob.lz4 similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/sample_channel/a6c00e0330c332be6ff2f08ccee26dc27750d23a818207f9/1565621688012.mdblob.lz4 rename to src/tribler/core/tests/tools/data/sample_channel/a6c00e0330c332be6ff2f08ccee26dc27750d23a818207f9/1565621688012.mdblob.lz4 diff --git a/src/tribler-core/tribler_core/tests/tools/data/sample_channel/a6c00e0330c332be6ff2f08ccee26dc27750d23a818207f9/1565621688015.mdblob.lz4 b/src/tribler/core/tests/tools/data/sample_channel/a6c00e0330c332be6ff2f08ccee26dc27750d23a818207f9/1565621688015.mdblob.lz4 similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/sample_channel/a6c00e0330c332be6ff2f08ccee26dc27750d23a818207f9/1565621688015.mdblob.lz4 rename to src/tribler/core/tests/tools/data/sample_channel/a6c00e0330c332be6ff2f08ccee26dc27750d23a818207f9/1565621688015.mdblob.lz4 diff --git a/src/tribler-core/tribler_core/tests/tools/data/sample_channel/a6c00e0330c332be6ff2f08ccee26dc27750d23a818207f9/1565621688018.mdblob.lz4 b/src/tribler/core/tests/tools/data/sample_channel/a6c00e0330c332be6ff2f08ccee26dc27750d23a818207f9/1565621688018.mdblob.lz4 similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/sample_channel/a6c00e0330c332be6ff2f08ccee26dc27750d23a818207f9/1565621688018.mdblob.lz4 rename to src/tribler/core/tests/tools/data/sample_channel/a6c00e0330c332be6ff2f08ccee26dc27750d23a818207f9/1565621688018.mdblob.lz4 diff --git a/src/tribler-core/tribler_core/tests/tools/data/sample_channel/channel.mdblob b/src/tribler/core/tests/tools/data/sample_channel/channel.mdblob similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/sample_channel/channel.mdblob rename to src/tribler/core/tests/tools/data/sample_channel/channel.mdblob diff --git a/src/tribler-core/tribler_core/tests/tools/data/sample_channel/channel.torrent b/src/tribler/core/tests/tools/data/sample_channel/channel.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/sample_channel/channel.torrent rename to src/tribler/core/tests/tools/data/sample_channel/channel.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/sample_channel/channel_upd.mdblob b/src/tribler/core/tests/tools/data/sample_channel/channel_upd.mdblob similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/sample_channel/channel_upd.mdblob rename to src/tribler/core/tests/tools/data/sample_channel/channel_upd.mdblob diff --git a/src/tribler-core/tribler_core/tests/tools/data/sample_channel/channel_upd.torrent b/src/tribler/core/tests/tools/data/sample_channel/channel_upd.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/sample_channel/channel_upd.torrent rename to src/tribler/core/tests/tools/data/sample_channel/channel_upd.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/bootstrap/foo b/src/tribler/core/tests/tools/data/state_dir_dummy/bootstrap/foo similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/bootstrap/foo rename to src/tribler/core/tests/tools/data/state_dir_dummy/bootstrap/foo diff --git a/src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/channels/123123/333.mdblob.lz4 b/src/tribler/core/tests/tools/data/state_dir_dummy/channels/123123/333.mdblob.lz4 similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/channels/123123/333.mdblob.lz4 rename to src/tribler/core/tests/tools/data/state_dir_dummy/channels/123123/333.mdblob.lz4 diff --git a/src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/dlcheckpoints/b496932f32daad964e1b63188faabf74d22b45ea.conf b/src/tribler/core/tests/tools/data/state_dir_dummy/dlcheckpoints/b496932f32daad964e1b63188faabf74d22b45ea.conf similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/dlcheckpoints/b496932f32daad964e1b63188faabf74d22b45ea.conf rename to src/tribler/core/tests/tools/data/state_dir_dummy/dlcheckpoints/b496932f32daad964e1b63188faabf74d22b45ea.conf diff --git a/src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/ec_multichain.pem b/src/tribler/core/tests/tools/data/state_dir_dummy/ec_multichain.pem similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/ec_multichain.pem rename to src/tribler/core/tests/tools/data/state_dir_dummy/ec_multichain.pem diff --git a/src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/ec_trustchain_testnet.pem b/src/tribler/core/tests/tools/data/state_dir_dummy/ec_trustchain_testnet.pem similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/ec_trustchain_testnet.pem rename to src/tribler/core/tests/tools/data/state_dir_dummy/ec_trustchain_testnet.pem diff --git a/src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/ecpub_multichain.pem b/src/tribler/core/tests/tools/data/state_dir_dummy/ecpub_multichain.pem similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/ecpub_multichain.pem rename to src/tribler/core/tests/tools/data/state_dir_dummy/ecpub_multichain.pem diff --git a/src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/ecpub_trustchain_testnet.pem b/src/tribler/core/tests/tools/data/state_dir_dummy/ecpub_trustchain_testnet.pem similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/ecpub_trustchain_testnet.pem rename to src/tribler/core/tests/tools/data/state_dir_dummy/ecpub_trustchain_testnet.pem diff --git a/src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/some_junk_dir/foo b/src/tribler/core/tests/tools/data/state_dir_dummy/some_junk_dir/foo similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/some_junk_dir/foo rename to src/tribler/core/tests/tools/data/state_dir_dummy/some_junk_dir/foo diff --git a/src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/some_junk_file b/src/tribler/core/tests/tools/data/state_dir_dummy/some_junk_file similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/some_junk_file rename to src/tribler/core/tests/tools/data/state_dir_dummy/some_junk_file diff --git a/src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/sqlite/metadata.db b/src/tribler/core/tests/tools/data/state_dir_dummy/sqlite/metadata.db similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/sqlite/metadata.db rename to src/tribler/core/tests/tools/data/state_dir_dummy/sqlite/metadata.db diff --git a/src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/triblerd.conf b/src/tribler/core/tests/tools/data/state_dir_dummy/triblerd.conf similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/triblerd.conf rename to src/tribler/core/tests/tools/data/state_dir_dummy/triblerd.conf diff --git a/src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/wallet/foo b/src/tribler/core/tests/tools/data/state_dir_dummy/wallet/foo similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/state_dir_dummy/wallet/foo rename to src/tribler/core/tests/tools/data/state_dir_dummy/wallet/foo diff --git a/src/tribler-core/tribler_core/tests/tools/data/test_rss.xml b/src/tribler/core/tests/tools/data/test_rss.xml similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/test_rss.xml rename to src/tribler/core/tests/tools/data/test_rss.xml diff --git a/src/tribler-core/tribler_core/tests/tools/data/test_rss_empty.xml b/src/tribler/core/tests/tools/data/test_rss_empty.xml similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/test_rss_empty.xml rename to src/tribler/core/tests/tools/data/test_rss_empty.xml diff --git a/src/tribler-core/tribler_core/tests/tools/data/torrent_creation_files/file1.txt b/src/tribler/core/tests/tools/data/torrent_creation_files/file1.txt similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/torrent_creation_files/file1.txt rename to src/tribler/core/tests/tools/data/torrent_creation_files/file1.txt diff --git a/src/tribler-core/tribler_core/tests/tools/data/torrent_creation_files/file2.txt b/src/tribler/core/tests/tools/data/torrent_creation_files/file2.txt similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/torrent_creation_files/file2.txt rename to src/tribler/core/tests/tools/data/torrent_creation_files/file2.txt diff --git a/src/tribler-core/tribler_core/tests/tools/data/ubuntu-15.04-desktop-amd64.iso.torrent b/src/tribler/core/tests/tools/data/ubuntu-15.04-desktop-amd64.iso.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/ubuntu-15.04-desktop-amd64.iso.torrent rename to src/tribler/core/tests/tools/data/ubuntu-15.04-desktop-amd64.iso.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/data/ubuntu-logo14.png b/src/tribler/core/tests/tools/data/ubuntu-logo14.png similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/ubuntu-logo14.png rename to src/tribler/core/tests/tools/data/ubuntu-logo14.png diff --git a/src/tribler-core/tribler_core/tests/tools/data/upgrade_databases/bandwidth_v8.db b/src/tribler/core/tests/tools/data/upgrade_databases/bandwidth_v8.db similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/upgrade_databases/bandwidth_v8.db rename to src/tribler/core/tests/tools/data/upgrade_databases/bandwidth_v8.db diff --git a/src/tribler-core/tribler_core/tests/tools/data/upgrade_databases/pony_v10.db b/src/tribler/core/tests/tools/data/upgrade_databases/pony_v10.db similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/upgrade_databases/pony_v10.db rename to src/tribler/core/tests/tools/data/upgrade_databases/pony_v10.db diff --git a/src/tribler-core/tribler_core/tests/tools/data/upgrade_databases/pony_v11.db b/src/tribler/core/tests/tools/data/upgrade_databases/pony_v11.db similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/upgrade_databases/pony_v11.db rename to src/tribler/core/tests/tools/data/upgrade_databases/pony_v11.db diff --git a/src/tribler-core/tribler_core/tests/tools/data/upgrade_databases/pony_v12.db b/src/tribler/core/tests/tools/data/upgrade_databases/pony_v12.db similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/upgrade_databases/pony_v12.db rename to src/tribler/core/tests/tools/data/upgrade_databases/pony_v12.db diff --git a/src/tribler-core/tribler_core/tests/tools/data/upgrade_databases/pony_v13.db b/src/tribler/core/tests/tools/data/upgrade_databases/pony_v13.db similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/upgrade_databases/pony_v13.db rename to src/tribler/core/tests/tools/data/upgrade_databases/pony_v13.db diff --git a/src/tribler-core/tribler_core/tests/tools/data/upgrade_databases/pony_v7.db b/src/tribler/core/tests/tools/data/upgrade_databases/pony_v7.db similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/upgrade_databases/pony_v7.db rename to src/tribler/core/tests/tools/data/upgrade_databases/pony_v7.db diff --git a/src/tribler-core/tribler_core/tests/tools/data/upgrade_databases/pony_v8.db b/src/tribler/core/tests/tools/data/upgrade_databases/pony_v8.db similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/upgrade_databases/pony_v8.db rename to src/tribler/core/tests/tools/data/upgrade_databases/pony_v8.db diff --git a/src/tribler-core/tribler_core/tests/tools/data/upgrade_databases/tags_v13.db b/src/tribler/core/tests/tools/data/upgrade_databases/tags_v13.db similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/upgrade_databases/tags_v13.db rename to src/tribler/core/tests/tools/data/upgrade_databases/tags_v13.db diff --git a/src/tribler-core/tribler_core/tests/tools/data/video.avi b/src/tribler/core/tests/tools/data/video.avi similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/video.avi rename to src/tribler/core/tests/tools/data/video.avi diff --git a/src/tribler-core/tribler_core/tests/tools/data/video.avi.torrent b/src/tribler/core/tests/tools/data/video.avi.torrent similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/data/video.avi.torrent rename to src/tribler/core/tests/tools/data/video.avi.torrent diff --git a/src/tribler-core/tribler_core/tests/tools/tracker/__init__.py b/src/tribler/core/tests/tools/tracker/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/tracker/__init__.py rename to src/tribler/core/tests/tools/tracker/__init__.py diff --git a/src/tribler-core/tribler_core/tests/tools/tracker/http_tracker.py b/src/tribler/core/tests/tools/tracker/http_tracker.py similarity index 93% rename from src/tribler-core/tribler_core/tests/tools/tracker/http_tracker.py rename to src/tribler/core/tests/tools/tracker/http_tracker.py index 2d758f9a5c7..42ded896507 100644 --- a/src/tribler-core/tribler_core/tests/tools/tracker/http_tracker.py +++ b/src/tribler/core/tests/tools/tracker/http_tracker.py @@ -3,8 +3,8 @@ from libtorrent import bencode -from tribler_core.components.restapi.rest.rest_endpoint import HTTP_BAD_REQUEST, RESTResponse -from tribler_core.tests.tools.tracker.tracker_info import TrackerInfo +from tribler.core.components.restapi.rest.rest_endpoint import HTTP_BAD_REQUEST, RESTResponse +from tribler.core.tests.tools.tracker.tracker_info import TrackerInfo class HTTPTracker: diff --git a/src/tribler-core/tribler_core/tests/tools/tracker/tracker_info.py b/src/tribler/core/tests/tools/tracker/tracker_info.py similarity index 100% rename from src/tribler-core/tribler_core/tests/tools/tracker/tracker_info.py rename to src/tribler/core/tests/tools/tracker/tracker_info.py diff --git a/src/tribler-core/tribler_core/tests/tools/tracker/udp_tracker.py b/src/tribler/core/tests/tools/tracker/udp_tracker.py similarity index 96% rename from src/tribler-core/tribler_core/tests/tools/tracker/udp_tracker.py rename to src/tribler/core/tests/tools/tracker/udp_tracker.py index ae0ac090f73..68289b50445 100644 --- a/src/tribler-core/tribler_core/tests/tools/tracker/udp_tracker.py +++ b/src/tribler/core/tests/tools/tracker/udp_tracker.py @@ -2,8 +2,8 @@ import struct from asyncio import DatagramProtocol, get_event_loop -from tribler_core.components.torrent_checker.torrent_checker.torrentchecker_session import MAX_INT32 -from tribler_core.tests.tools.tracker.tracker_info import TrackerInfo +from tribler.core.components.torrent_checker.torrent_checker.torrentchecker_session import MAX_INT32 +from tribler.core.tests.tools.tracker.tracker_info import TrackerInfo UDP_TRACKER_INIT_CONNECTION_ID = 0x41727101980 LENGTH_INFOHASH = 20 diff --git a/src/tribler-core/tribler_core/update_version_from_git.py b/src/tribler/core/update_version_from_git.py similarity index 100% rename from src/tribler-core/tribler_core/update_version_from_git.py rename to src/tribler/core/update_version_from_git.py diff --git a/src/tribler-core/tribler_core/upgrade/tests/__init__.py b/src/tribler/core/upgrade/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/upgrade/tests/__init__.py rename to src/tribler/core/upgrade/__init__.py diff --git a/src/tribler-core/tribler_core/upgrade/config_converter.py b/src/tribler/core/upgrade/config_converter.py similarity index 100% rename from src/tribler-core/tribler_core/upgrade/config_converter.py rename to src/tribler/core/upgrade/config_converter.py diff --git a/src/tribler-core/tribler_core/upgrade/db8_to_db10.py b/src/tribler/core/upgrade/db8_to_db10.py similarity index 99% rename from src/tribler-core/tribler_core/upgrade/db8_to_db10.py rename to src/tribler/core/upgrade/db8_to_db10.py index 1188112d912..3db159bd91a 100644 --- a/src/tribler-core/tribler_core/upgrade/db8_to_db10.py +++ b/src/tribler/core/upgrade/db8_to_db10.py @@ -7,7 +7,7 @@ from pony.orm import db_session -from tribler_core.components.metadata_store.db.store import MetadataStore +from tribler.core.components.metadata_store.db.store import MetadataStore TABLE_NAMES = ( "ChannelNode", "TorrentState", "TorrentState_TrackerState", "ChannelPeer", "ChannelVote", "TrackerState", "Vsids") diff --git a/src/tribler-core/tribler_core/utilities/tests/__init__.py b/src/tribler/core/upgrade/tests/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/utilities/tests/__init__.py rename to src/tribler/core/upgrade/tests/__init__.py diff --git a/src/tribler-core/tribler_core/upgrade/tests/test_config_upgrade_to_76.py b/src/tribler/core/upgrade/tests/test_config_upgrade_to_76.py similarity index 75% rename from src/tribler-core/tribler_core/upgrade/tests/test_config_upgrade_to_76.py rename to src/tribler/core/upgrade/tests/test_config_upgrade_to_76.py index d6387d655dd..73d82755e67 100644 --- a/src/tribler-core/tribler_core/upgrade/tests/test_config_upgrade_to_76.py +++ b/src/tribler/core/upgrade/tests/test_config_upgrade_to_76.py @@ -1,8 +1,8 @@ import shutil -from tribler_core.config.tribler_config import TriblerConfig -from tribler_core.tests.tools.common import TESTS_DATA_DIR -from tribler_core.upgrade.config_converter import convert_config_to_tribler76 +from tribler.core.config.tribler_config import TriblerConfig +from tribler.core.tests.tools.common import TESTS_DATA_DIR +from tribler.core.upgrade.config_converter import convert_config_to_tribler76 CONFIG_PATH = TESTS_DATA_DIR / "config_files" diff --git a/src/tribler-core/tribler_core/upgrade/tests/test_upgrader.py b/src/tribler/core/upgrade/tests/test_upgrader.py similarity index 94% rename from src/tribler-core/tribler_core/upgrade/tests/test_upgrader.py rename to src/tribler/core/upgrade/tests/test_upgrader.py index 37a38696781..9b2be656980 100644 --- a/src/tribler-core/tribler_core/upgrade/tests/test_upgrader.py +++ b/src/tribler/core/upgrade/tests/test_upgrader.py @@ -8,14 +8,14 @@ import pytest -from tribler_core.components.bandwidth_accounting.db.database import BandwidthDatabase -from tribler_core.components.metadata_store.db.orm_bindings.channel_metadata import CHANNEL_DIR_NAME_LENGTH -from tribler_core.components.metadata_store.db.store import CURRENT_DB_VERSION, MetadataStore -from tribler_core.components.tag.db.tag_db import TagDatabase -from tribler_core.tests.tools.common import TESTS_DATA_DIR -from tribler_core.upgrade.db8_to_db10 import calc_progress -from tribler_core.upgrade.upgrade import TriblerUpgrader, cleanup_noncompliant_channel_torrents -from tribler_core.utilities.configparser import CallbackConfigParser +from tribler.core.components.bandwidth_accounting.db.database import BandwidthDatabase +from tribler.core.components.metadata_store.db.orm_bindings.channel_metadata import CHANNEL_DIR_NAME_LENGTH +from tribler.core.components.metadata_store.db.store import CURRENT_DB_VERSION, MetadataStore +from tribler.core.components.tag.db.tag_db import TagDatabase +from tribler.core.tests.tools.common import TESTS_DATA_DIR +from tribler.core.upgrade.db8_to_db10 import calc_progress +from tribler.core.upgrade.upgrade import TriblerUpgrader, cleanup_noncompliant_channel_torrents +from tribler.core.utilities.configparser import CallbackConfigParser # pylint: disable=redefined-outer-name, protected-access diff --git a/src/tribler-core/tribler_core/upgrade/tests/test_version_manager.py b/src/tribler/core/upgrade/tests/test_version_manager.py similarity index 98% rename from src/tribler-core/tribler_core/upgrade/tests/test_version_manager.py rename to src/tribler/core/upgrade/tests/test_version_manager.py index 91b85386475..06c48f4859f 100644 --- a/src/tribler-core/tribler_core/upgrade/tests/test_version_manager.py +++ b/src/tribler/core/upgrade/tests/test_version_manager.py @@ -6,16 +6,16 @@ import pytest -import tribler_core.version -from tribler_core.tests.tools.common import TESTS_DATA_DIR -from tribler_core.upgrade.version_manager import ( +import tribler.core.version +from tribler.core.tests.tools.common import TESTS_DATA_DIR +from tribler.core.upgrade.version_manager import ( TriblerVersion, VERSION_HISTORY_FILENAME, VersionError, VersionHistory, remove_state_dirs, ) -from tribler_core.utilities.simpledefs import STATEDIR_CHANNELS_DIR, STATEDIR_CHECKPOINT_DIR, STATEDIR_DB_DIR +from tribler.core.utilities.simpledefs import STATEDIR_CHANNELS_DIR, STATEDIR_CHECKPOINT_DIR, STATEDIR_DB_DIR DUMMY_STATE_DIR = TESTS_DATA_DIR / "state_dir_dummy" @@ -388,7 +388,7 @@ def test_coverage(tmpdir): (root_state_dir / 'triblerd.conf').write_text("abc") history = VersionHistory(root_state_dir) - assert history.code_version.version_str == tribler_core.version.version_id + assert history.code_version.version_str == tribler.core.version.version_id assert repr(history) == "" dirs = history.get_disposable_state_directories() diff --git a/src/tribler-core/tribler_core/upgrade/upgrade.py b/src/tribler/core/upgrade/upgrade.py similarity index 96% rename from src/tribler-core/tribler_core/upgrade/upgrade.py rename to src/tribler/core/upgrade/upgrade.py index a2b3f974a27..8ab7e2daebf 100644 --- a/src/tribler-core/tribler_core/upgrade/upgrade.py +++ b/src/tribler/core/upgrade/upgrade.py @@ -9,20 +9,20 @@ from pony.orm import db_session, delete -from tribler_core.components.bandwidth_accounting.db.database import BandwidthDatabase -from tribler_core.components.metadata_store.db.orm_bindings.channel_metadata import CHANNEL_DIR_NAME_LENGTH -from tribler_core.components.metadata_store.db.store import ( +from tribler.core.components.bandwidth_accounting.db.database import BandwidthDatabase +from tribler.core.components.metadata_store.db.orm_bindings.channel_metadata import CHANNEL_DIR_NAME_LENGTH +from tribler.core.components.metadata_store.db.store import ( MetadataStore, sql_create_partial_index_channelnode_metadata_type, sql_create_partial_index_channelnode_subscribed, sql_create_partial_index_torrentstate_last_check, ) -from tribler_core.components.tag.db.tag_db import TagDatabase -from tribler_core.upgrade.config_converter import convert_config_to_tribler76 -from tribler_core.upgrade.db8_to_db10 import PonyToPonyMigration, get_db_version -from tribler_core.utilities.configparser import CallbackConfigParser -from tribler_core.utilities.path_util import Path -from tribler_core.utilities.simpledefs import STATEDIR_CHANNELS_DIR, STATEDIR_DB_DIR +from tribler.core.components.tag.db.tag_db import TagDatabase +from tribler.core.upgrade.config_converter import convert_config_to_tribler76 +from tribler.core.upgrade.db8_to_db10 import PonyToPonyMigration, get_db_version +from tribler.core.utilities.configparser import CallbackConfigParser +from tribler.core.utilities.path_util import Path +from tribler.core.utilities.simpledefs import STATEDIR_CHANNELS_DIR, STATEDIR_DB_DIR # pylint: disable=protected-access diff --git a/src/tribler-core/tribler_core/upgrade/version_manager.py b/src/tribler/core/upgrade/version_manager.py similarity index 98% rename from src/tribler-core/tribler_core/upgrade/version_manager.py rename to src/tribler/core/upgrade/version_manager.py index 5ec1ac3cf00..954f89ed68d 100644 --- a/src/tribler-core/tribler_core/upgrade/version_manager.py +++ b/src/tribler/core/upgrade/version_manager.py @@ -11,9 +11,9 @@ from pathlib import Path from typing import Dict, List, Optional, Tuple -from tribler_core.utilities.simpledefs import STATEDIR_CHANNELS_DIR, STATEDIR_CHECKPOINT_DIR, STATEDIR_DB_DIR +from tribler.core.utilities.simpledefs import STATEDIR_CHANNELS_DIR, STATEDIR_CHECKPOINT_DIR, STATEDIR_DB_DIR -import tribler_core.version +import tribler.core.version VERSION_HISTORY_FILENAME = "version_history.json" @@ -193,7 +193,7 @@ class VersionHistory: # pylint: disable=too-many-branches def __init__(self, root_state_dir: Path, code_version_id: Optional[str] = None): if code_version_id is None: - code_version_id = tribler_core.version.version_id + code_version_id = tribler.core.version.version_id self.root_state_dir = root_state_dir self.file_path = root_state_dir / VERSION_HISTORY_FILENAME diff --git a/src/tribler-core/tribler_core/utilities/__init__.py b/src/tribler/core/utilities/__init__.py similarity index 100% rename from src/tribler-core/tribler_core/utilities/__init__.py rename to src/tribler/core/utilities/__init__.py diff --git a/src/tribler-core/tribler_core/utilities/bencodecheck.py b/src/tribler/core/utilities/bencodecheck.py similarity index 100% rename from src/tribler-core/tribler_core/utilities/bencodecheck.py rename to src/tribler/core/utilities/bencodecheck.py diff --git a/src/tribler-core/tribler_core/utilities/configparser.py b/src/tribler/core/utilities/configparser.py similarity index 97% rename from src/tribler-core/tribler_core/utilities/configparser.py rename to src/tribler/core/utilities/configparser.py index a1a2a9ebb4d..991cf98e7f5 100644 --- a/src/tribler-core/tribler_core/utilities/configparser.py +++ b/src/tribler/core/utilities/configparser.py @@ -9,7 +9,7 @@ from io import StringIO from threading import RLock -from tribler_core.exceptions import OperationNotPossibleAtRuntimeException +from tribler.core.exceptions import OperationNotPossibleAtRuntimeException class CallbackConfigParser(RawConfigParser): diff --git a/src/tribler-core/tribler_core/utilities/crypto_patcher.py b/src/tribler/core/utilities/crypto_patcher.py similarity index 92% rename from src/tribler-core/tribler_core/utilities/crypto_patcher.py rename to src/tribler/core/utilities/crypto_patcher.py index 950f8cf0005..15f994a3970 100644 --- a/src/tribler-core/tribler_core/utilities/crypto_patcher.py +++ b/src/tribler/core/utilities/crypto_patcher.py @@ -1,6 +1,6 @@ import sys -from tribler_core.utilities.utilities import is_frozen +from tribler.core.utilities.utilities import is_frozen def patch_crypto_be_discovery(): diff --git a/src/tribler-core/tribler_core/utilities/dependencies.py b/src/tribler/core/utilities/dependencies.py similarity index 82% rename from src/tribler-core/tribler_core/utilities/dependencies.py rename to src/tribler/core/utilities/dependencies.py index da5b5b5af88..8378a58b0c5 100644 --- a/src/tribler-core/tribler_core/utilities/dependencies.py +++ b/src/tribler/core/utilities/dependencies.py @@ -5,10 +5,10 @@ """ import logging import re +import tribler from enum import Enum from typing import Iterator, Optional - -from tribler_core.utilities.path_util import Path +from tribler.core.utilities.path_util import Path # fmt: off @@ -26,13 +26,11 @@ def get_dependencies(scope: Scope) -> Iterator[str]: def _get_path_to_requirements_txt() -> Optional[Path]: - requirements_txt = 'requirements.txt' + root_path = Path(tribler.__file__).parent.parent.parent if scope == Scope.core: - import tribler_core - return Path(tribler_core.__file__).parent / requirements_txt + return root_path / 'requirements-core.txt' if scope == Scope.gui: - import tribler_gui - return Path(tribler_gui.__file__).parent / requirements_txt + return root_path / 'requirements.txt' raise AttributeError(f'Scope is {scope} but should be in {[s for s in Scope]}') # pylint: disable=unnecessary-comprehension return _get_pip_dependencies(_get_path_to_requirements_txt()) diff --git a/src/tribler-core/tribler_core/utilities/install_dir.py b/src/tribler/core/utilities/install_dir.py similarity index 64% rename from src/tribler-core/tribler_core/utilities/install_dir.py rename to src/tribler/core/utilities/install_dir.py index c235a4da111..f877fedc46c 100644 --- a/src/tribler-core/tribler_core/utilities/install_dir.py +++ b/src/tribler/core/utilities/install_dir.py @@ -5,9 +5,9 @@ """ import sys -import tribler_core -from tribler_core.utilities.path_util import Path -from tribler_core.utilities.utilities import is_frozen +import tribler.core +from tribler.core.utilities.path_util import Path +from tribler.core.utilities.utilities import is_frozen def get_base_path(): @@ -16,7 +16,7 @@ def get_base_path(): # PyInstaller creates a temp folder and stores path in _MEIPASS base_path = Path(sys._MEIPASS) except Exception: - base_path = Path(tribler_core.__file__).parent + base_path = Path(tribler.core.__file__).parent fixed_filename = Path.fix_win_long_file(base_path) return Path(fixed_filename) @@ -24,5 +24,5 @@ def get_base_path(): def get_lib_path(): if is_frozen(): - return get_base_path() / 'tribler_source' / 'tribler_core' + return get_base_path() / 'tribler_source/tribler/core' return get_base_path() diff --git a/src/tribler-core/tribler_core/utilities/instrumentation.py b/src/tribler/core/utilities/instrumentation.py similarity index 100% rename from src/tribler-core/tribler_core/utilities/instrumentation.py rename to src/tribler/core/utilities/instrumentation.py diff --git a/src/tribler-core/tribler_core/utilities/maketorrent.py b/src/tribler/core/utilities/maketorrent.py similarity index 82% rename from src/tribler-core/tribler_core/utilities/maketorrent.py rename to src/tribler/core/utilities/maketorrent.py index 37b10dec11b..5aef404167a 100644 --- a/src/tribler-core/tribler_core/utilities/maketorrent.py +++ b/src/tribler/core/utilities/maketorrent.py @@ -3,9 +3,9 @@ Author(s): Arno Bakker, Bram Cohen """ -from tribler_core.utilities import path_util -from tribler_core.utilities.path_util import Path -from tribler_core.utilities.unicode import ensure_unicode_detect_encoding +from tribler.core.utilities import path_util +from tribler.core.utilities.path_util import Path +from tribler.core.utilities.unicode import ensure_unicode_detect_encoding def pathlist2filename(pathlist): diff --git a/src/tribler-core/tribler_core/utilities/network_utils.py b/src/tribler/core/utilities/network_utils.py similarity index 100% rename from src/tribler-core/tribler_core/utilities/network_utils.py rename to src/tribler/core/utilities/network_utils.py diff --git a/src/tribler-core/tribler_core/utilities/notifier.py b/src/tribler/core/utilities/notifier.py similarity index 100% rename from src/tribler-core/tribler_core/utilities/notifier.py rename to src/tribler/core/utilities/notifier.py diff --git a/src/tribler-core/tribler_core/utilities/osutils.py b/src/tribler/core/utilities/osutils.py similarity index 99% rename from src/tribler-core/tribler_core/utilities/osutils.py rename to src/tribler/core/utilities/osutils.py index e145a4e2232..fb16ce67fc7 100644 --- a/src/tribler-core/tribler_core/utilities/osutils.py +++ b/src/tribler/core/utilities/osutils.py @@ -14,7 +14,7 @@ import sys from pathlib import Path -from tribler_core.utilities import path_util +from tribler.core.utilities import path_util logger = logging.getLogger(__name__) diff --git a/src/tribler-core/tribler_core/utilities/patch_import.py b/src/tribler/core/utilities/patch_import.py similarity index 100% rename from src/tribler-core/tribler_core/utilities/patch_import.py rename to src/tribler/core/utilities/patch_import.py diff --git a/src/tribler-core/tribler_core/utilities/path_util.py b/src/tribler/core/utilities/path_util.py similarity index 100% rename from src/tribler-core/tribler_core/utilities/path_util.py rename to src/tribler/core/utilities/path_util.py diff --git a/src/tribler-core/tribler_core/utilities/pony_utils.py b/src/tribler/core/utilities/pony_utils.py similarity index 100% rename from src/tribler-core/tribler_core/utilities/pony_utils.py rename to src/tribler/core/utilities/pony_utils.py diff --git a/src/tribler-core/tribler_core/utilities/process_checker.py b/src/tribler/core/utilities/process_checker.py similarity index 100% rename from src/tribler-core/tribler_core/utilities/process_checker.py rename to src/tribler/core/utilities/process_checker.py diff --git a/src/tribler-core/tribler_core/utilities/rest_utils.py b/src/tribler/core/utilities/rest_utils.py similarity index 100% rename from src/tribler-core/tribler_core/utilities/rest_utils.py rename to src/tribler/core/utilities/rest_utils.py diff --git a/src/tribler-core/tribler_core/utilities/search_utils.py b/src/tribler/core/utilities/search_utils.py similarity index 100% rename from src/tribler-core/tribler_core/utilities/search_utils.py rename to src/tribler/core/utilities/search_utils.py diff --git a/src/tribler-core/tribler_core/utilities/sentinels.py b/src/tribler/core/utilities/sentinels.py similarity index 100% rename from src/tribler-core/tribler_core/utilities/sentinels.py rename to src/tribler/core/utilities/sentinels.py diff --git a/src/tribler-core/tribler_core/utilities/simpledefs.py b/src/tribler/core/utilities/simpledefs.py similarity index 100% rename from src/tribler-core/tribler_core/utilities/simpledefs.py rename to src/tribler/core/utilities/simpledefs.py diff --git a/src/tribler-gui/tribler_gui/tests/__init__.py b/src/tribler/core/utilities/tests/__init__.py similarity index 100% rename from src/tribler-gui/tribler_gui/tests/__init__.py rename to src/tribler/core/utilities/tests/__init__.py diff --git a/src/tribler-core/tribler_core/utilities/tests/test_bencodecheck.py b/src/tribler/core/utilities/tests/test_bencodecheck.py similarity index 97% rename from src/tribler-core/tribler_core/utilities/tests/test_bencodecheck.py rename to src/tribler/core/utilities/tests/test_bencodecheck.py index 9581af2d1e1..e96ba45a7e3 100644 --- a/src/tribler-core/tribler_core/utilities/tests/test_bencodecheck.py +++ b/src/tribler/core/utilities/tests/test_bencodecheck.py @@ -1,6 +1,6 @@ import pytest -from tribler_core.utilities.bencodecheck import is_bencoded +from tribler.core.utilities.bencodecheck import is_bencoded def test_bencode_checker(): diff --git a/src/tribler-core/tribler_core/utilities/tests/test_dependencies.py b/src/tribler/core/utilities/tests/test_dependencies.py similarity index 84% rename from src/tribler-core/tribler_core/utilities/tests/test_dependencies.py rename to src/tribler/core/utilities/tests/test_dependencies.py index 5e2309b727c..ca0ba906df6 100644 --- a/src/tribler-core/tribler_core/utilities/tests/test_dependencies.py +++ b/src/tribler/core/utilities/tests/test_dependencies.py @@ -1,14 +1,14 @@ import pytest -from tribler_core.utilities.dependencies import ( +from tribler.core.utilities.dependencies import ( Scope, _extract_libraries_from_requirements, _get_pip_dependencies, get_dependencies, ) -import tribler_core -from tribler_core.utilities.path_util import Path +import tribler.core +from tribler.core.utilities.path_util import Path pytestmark = pytest.mark.asyncio @@ -29,7 +29,7 @@ async def test_extract_libraries_from_requirements(): async def test_pip_dependencies_gen(): # check that libraries extracts from file correctly - path = Path(tribler_core.__file__).parent / 'requirements.txt' + path = Path(tribler.__file__).parent.parent.parent / 'requirements.txt' assert list(_get_pip_dependencies(path)) diff --git a/src/tribler-core/tribler_core/utilities/tests/test_maketorrent.py b/src/tribler/core/utilities/tests/test_maketorrent.py similarity index 74% rename from src/tribler-core/tribler_core/utilities/tests/test_maketorrent.py rename to src/tribler/core/utilities/tests/test_maketorrent.py index 74b7e4714cd..53dc472fad0 100644 --- a/src/tribler-core/tribler_core/utilities/tests/test_maketorrent.py +++ b/src/tribler/core/utilities/tests/test_maketorrent.py @@ -1,5 +1,5 @@ -from tribler_core.utilities.maketorrent import pathlist2filename -from tribler_core.utilities.path_util import Path +from tribler.core.utilities.maketorrent import pathlist2filename +from tribler.core.utilities.path_util import Path def test_pathlist2filename_utf8(): diff --git a/src/tribler-core/tribler_core/utilities/tests/test_network_utils.py b/src/tribler/core/utilities/tests/test_network_utils.py similarity index 96% rename from src/tribler-core/tribler_core/utilities/tests/test_network_utils.py rename to src/tribler/core/utilities/tests/test_network_utils.py index b7cacbc2b16..12ad569ec3b 100644 --- a/src/tribler-core/tribler_core/utilities/tests/test_network_utils.py +++ b/src/tribler/core/utilities/tests/test_network_utils.py @@ -1,6 +1,6 @@ import pytest -from tribler_core.utilities.network_utils import FreePortNotFoundError, NetworkUtils +from tribler.core.utilities.network_utils import FreePortNotFoundError, NetworkUtils # fmt: off diff --git a/src/tribler-core/tribler_core/utilities/tests/test_notifier.py b/src/tribler/core/utilities/tests/test_notifier.py similarity index 99% rename from src/tribler-core/tribler_core/utilities/tests/test_notifier.py rename to src/tribler/core/utilities/tests/test_notifier.py index cacb2f076a6..62cc4375c23 100644 --- a/src/tribler-core/tribler_core/utilities/tests/test_notifier.py +++ b/src/tribler/core/utilities/tests/test_notifier.py @@ -3,7 +3,7 @@ import pytest -from tribler_core.utilities.notifier import Notifier, NotifierError +from tribler.core.utilities.notifier import Notifier, NotifierError # pylint: disable=unused-argument diff --git a/src/tribler-core/tribler_core/utilities/tests/test_osutils.py b/src/tribler/core/utilities/tests/test_osutils.py similarity index 97% rename from src/tribler-core/tribler_core/utilities/tests/test_osutils.py rename to src/tribler/core/utilities/tests/test_osutils.py index 3e9a310ce86..51c265820fb 100644 --- a/src/tribler-core/tribler_core/utilities/tests/test_osutils.py +++ b/src/tribler/core/utilities/tests/test_osutils.py @@ -2,7 +2,7 @@ import sys from pathlib import Path -from tribler_core.utilities.osutils import ( +from tribler.core.utilities.osutils import ( dir_copy, fix_filebasename, get_appstate_dir, @@ -12,7 +12,7 @@ is_android, ) -from tribler_core.check_os import is_tribler_process +from tribler.core.check_os import is_tribler_process def test_fix_filebasename(): diff --git a/src/tribler-core/tribler_core/utilities/tests/test_patch_import.py b/src/tribler/core/utilities/tests/test_patch_import.py similarity index 96% rename from src/tribler-core/tribler_core/utilities/tests/test_patch_import.py rename to src/tribler/core/utilities/tests/test_patch_import.py index 290ddbcb2c8..645fd8377ff 100644 --- a/src/tribler-core/tribler_core/utilities/tests/test_patch_import.py +++ b/src/tribler/core/utilities/tests/test_patch_import.py @@ -2,7 +2,7 @@ import pytest -from tribler_core.utilities.patch_import import patch_import +from tribler.core.utilities.patch_import import patch_import pytestmark = pytest.mark.asyncio diff --git a/src/tribler-core/tribler_core/utilities/tests/test_path_utils.py b/src/tribler/core/utilities/tests/test_path_utils.py similarity index 92% rename from src/tribler-core/tribler_core/utilities/tests/test_path_utils.py rename to src/tribler/core/utilities/tests/test_path_utils.py index 5d8f1d1aec0..97ba643bdd0 100644 --- a/src/tribler-core/tribler_core/utilities/tests/test_path_utils.py +++ b/src/tribler/core/utilities/tests/test_path_utils.py @@ -1,6 +1,6 @@ import pytest -from tribler_core.utilities.path_util import Path +from tribler.core.utilities.path_util import Path @pytest.mark.asyncio diff --git a/src/tribler-core/tribler_core/utilities/tests/test_process_checker.py b/src/tribler/core/utilities/tests/test_process_checker.py similarity index 97% rename from src/tribler-core/tribler_core/utilities/tests/test_process_checker.py rename to src/tribler/core/utilities/tests/test_process_checker.py index 3b767c4134b..462bea61786 100644 --- a/src/tribler-core/tribler_core/utilities/tests/test_process_checker.py +++ b/src/tribler/core/utilities/tests/test_process_checker.py @@ -5,7 +5,7 @@ import pytest -from tribler_core.utilities.process_checker import LOCK_FILE_NAME, ProcessChecker +from tribler.core.utilities.process_checker import LOCK_FILE_NAME, ProcessChecker @pytest.fixture diff --git a/src/tribler-core/tribler_core/utilities/tests/test_rest_utils.py b/src/tribler/core/utilities/tests/test_rest_utils.py similarity index 96% rename from src/tribler-core/tribler_core/utilities/tests/test_rest_utils.py rename to src/tribler/core/utilities/tests/test_rest_utils.py index dc5b305193d..ea60f7f1382 100644 --- a/src/tribler-core/tribler_core/utilities/tests/test_rest_utils.py +++ b/src/tribler/core/utilities/tests/test_rest_utils.py @@ -2,7 +2,7 @@ import pytest -from tribler_core.utilities.rest_utils import path_to_uri, scheme_from_uri, uri_is_valid_file, uri_to_path +from tribler.core.utilities.rest_utils import path_to_uri, scheme_from_uri, uri_is_valid_file, uri_to_path NIX_PATHS = [ ('/path/to/file', 'file:///path/to/file'), diff --git a/src/tribler-core/tribler_core/utilities/tests/test_torrent_utils.py b/src/tribler/core/utilities/tests/test_torrent_utils.py similarity index 92% rename from src/tribler-core/tribler_core/utilities/tests/test_torrent_utils.py rename to src/tribler/core/utilities/tests/test_torrent_utils.py index 4bafeb5204d..be1bd5dee3c 100644 --- a/src/tribler-core/tribler_core/utilities/tests/test_torrent_utils.py +++ b/src/tribler/core/utilities/tests/test_torrent_utils.py @@ -2,13 +2,13 @@ import pytest -from tribler_core.components.libtorrent.utils.torrent_utils import ( +from tribler.core.components.libtorrent.utils.torrent_utils import ( commonprefix, create_torrent_file, get_info_from_handle, ) -from tribler_core.tests.tools.common import TESTS_DATA_DIR -from tribler_core.utilities.path_util import Path +from tribler.core.tests.tools.common import TESTS_DATA_DIR +from tribler.core.utilities.path_util import Path TORRENT_DATA_DIR = TESTS_DATA_DIR / "torrent_creation_files" FILE1_NAME = "file1.txt" diff --git a/src/tribler-core/tribler_core/utilities/tests/test_tracker_utils.py b/src/tribler/core/utilities/tests/test_tracker_utils.py similarity index 98% rename from src/tribler-core/tribler_core/utilities/tests/test_tracker_utils.py rename to src/tribler/core/utilities/tests/test_tracker_utils.py index 19b31d1dcca..7ca7bfdb241 100644 --- a/src/tribler-core/tribler_core/utilities/tests/test_tracker_utils.py +++ b/src/tribler/core/utilities/tests/test_tracker_utils.py @@ -1,6 +1,6 @@ import pytest -from tribler_core.utilities.tracker_utils import ( +from tribler.core.utilities.tracker_utils import ( MalformedTrackerURLException, get_uniformed_tracker_url, parse_tracker_url, diff --git a/src/tribler-core/tribler_core/utilities/tests/test_utilities.py b/src/tribler/core/utilities/tests/test_utilities.py similarity index 94% rename from src/tribler-core/tribler_core/utilities/tests/test_utilities.py rename to src/tribler/core/utilities/tests/test_utilities.py index 26b39c50605..7e5a6cd3071 100644 --- a/src/tribler-core/tribler_core/utilities/tests/test_utilities.py +++ b/src/tribler/core/utilities/tests/test_utilities.py @@ -5,10 +5,10 @@ import pytest -from tribler_core.logger.logger import load_logger_config -from tribler_core.utilities.patch_import import patch_import -from tribler_core.utilities.tracker_utils import add_url_params -from tribler_core.utilities.utilities import ( +from tribler.core.logger.logger import load_logger_config +from tribler.core.utilities.patch_import import patch_import +from tribler.core.utilities.tracker_utils import add_url_params +from tribler.core.utilities.utilities import ( Query, extract_tags, is_channel_public_key, @@ -160,7 +160,7 @@ def test_parse_query(): @patch_import(modules=['win32api'], MessageBox=MagicMock()) @patch('platform.system', new=MagicMock(return_value='Windows')) -@patch('tribler_core.utilities.utilities.print', new=MagicMock) +@patch('tribler.core.utilities.utilities.print', new=MagicMock) def test_show_system_popup_win(): # in this test "double mocking techniques" has been applied # there are different mocks that will work depending on the target machine's OS @@ -181,7 +181,7 @@ def test_show_system_popup_win(): @patch_import(modules=['subprocess'], Popen=MagicMock()) @patch('platform.system', new=MagicMock(return_value='Linux')) -@patch('tribler_core.utilities.utilities.print', new=MagicMock) +@patch('tribler.core.utilities.utilities.print', new=MagicMock) def test_show_system_popup_linux(): import subprocess @@ -192,7 +192,7 @@ def test_show_system_popup_linux(): @patch_import(modules=['subprocess'], Popen=MagicMock()) @patch('platform.system', new=MagicMock(return_value='Darwin')) -@patch('tribler_core.utilities.print', new=MagicMock) +@patch('tribler.core.utilities.print', new=MagicMock) def test_show_system_popup_darwin(): import subprocess @@ -202,7 +202,7 @@ def test_show_system_popup_darwin(): @patch('platform.system', new=MagicMock(return_value='Unknown')) -@patch('tribler_core.utilities.utilities.print') +@patch('tribler.core.utilities.utilities.print') def test_show_system_popup_unknown(mocked_print): show_system_popup('title', 'text') mocked_print.assert_called_with('cannot create native pop-up for system Unknown') @@ -210,7 +210,7 @@ def test_show_system_popup_unknown(mocked_print): @patch_import(modules=['subprocess'], Popen=MagicMock(side_effect=ValueError)) @patch('platform.system', new=MagicMock(return_value='Darwin')) -@patch('tribler_core.utilities.utilities.print') +@patch('tribler.core.utilities.utilities.print') def test_show_system_popup_exception(mocked_print): with patch('subprocess.Popen', new=MagicMock(side_effect=ValueError)): show_system_popup('title', 'text') diff --git a/src/tribler-core/tribler_core/utilities/tiny_tribler_service.py b/src/tribler/core/utilities/tiny_tribler_service.py similarity index 92% rename from src/tribler-core/tribler_core/utilities/tiny_tribler_service.py rename to src/tribler/core/utilities/tiny_tribler_service.py index 3a406945900..7fb8fd1539f 100644 --- a/src/tribler-core/tribler_core/utilities/tiny_tribler_service.py +++ b/src/tribler/core/utilities/tiny_tribler_service.py @@ -4,10 +4,10 @@ from pathlib import Path from typing import List -from tribler_core.components.base import Component -from tribler_core.start_core import Session -from tribler_core.utilities.osutils import get_root_state_directory -from tribler_core.utilities.process_checker import ProcessChecker +from tribler.core.components.base import Component +from tribler.core.start_core import Session +from tribler.core.utilities.osutils import get_root_state_directory +from tribler.core.utilities.process_checker import ProcessChecker class TinyTriblerService: diff --git a/src/tribler-core/tribler_core/utilities/tracker_utils.py b/src/tribler/core/utilities/tracker_utils.py similarity index 100% rename from src/tribler-core/tribler_core/utilities/tracker_utils.py rename to src/tribler/core/utilities/tracker_utils.py diff --git a/src/tribler-core/tribler_core/utilities/unicode.py b/src/tribler/core/utilities/unicode.py similarity index 100% rename from src/tribler-core/tribler_core/utilities/unicode.py rename to src/tribler/core/utilities/unicode.py diff --git a/src/tribler-core/tribler_core/utilities/utilities.py b/src/tribler/core/utilities/utilities.py similarity index 98% rename from src/tribler-core/tribler_core/utilities/utilities.py rename to src/tribler/core/utilities/utilities.py index 8256f0eb109..5c70ebf797c 100644 --- a/src/tribler-core/tribler_core/utilities/utilities.py +++ b/src/tribler/core/utilities/utilities.py @@ -16,8 +16,8 @@ from typing import Set, Tuple from urllib.parse import parse_qsl, urlsplit -from tribler_core.components.libtorrent.utils.libtorrent_helper import libtorrent as lt -from tribler_core.utilities.sentinels import sentinel +from tribler.core.components.libtorrent.utils.libtorrent_helper import libtorrent as lt +from tribler.core.utilities.sentinels import sentinel logger = logging.getLogger(__name__) diff --git a/src/tribler-core/tribler_core/version.py b/src/tribler/core/version.py similarity index 100% rename from src/tribler-core/tribler_core/version.py rename to src/tribler/core/version.py diff --git a/src/tribler-gui/tribler_gui/__init__.py b/src/tribler/gui/__init__.py similarity index 64% rename from src/tribler-gui/tribler_gui/__init__.py rename to src/tribler/gui/__init__.py index 7d706e4b5d5..302f39583f4 100644 --- a/src/tribler-gui/tribler_gui/__init__.py +++ b/src/tribler/gui/__init__.py @@ -1,6 +1,6 @@ """ This package contains the code for the GUI, written in pyQt. """ -from tribler_core.sentry_reporter.sentry_reporter import SentryReporter +from tribler.core.sentry_reporter.sentry_reporter import SentryReporter gui_sentry_reporter = SentryReporter() diff --git a/src/tribler-gui/tribler_gui/code_executor.py b/src/tribler/gui/code_executor.py similarity index 98% rename from src/tribler-gui/tribler_gui/code_executor.py rename to src/tribler/gui/code_executor.py index a3afc771b94..eee80d8e50e 100644 --- a/src/tribler-gui/tribler_gui/code_executor.py +++ b/src/tribler/gui/code_executor.py @@ -9,7 +9,7 @@ from PyQt5.QtNetwork import QTcpServer -from tribler_gui.utilities import connect, take_screenshot +from tribler.gui.utilities import connect, take_screenshot class CodeExecutor: diff --git a/src/tribler-gui/tribler_gui/core_manager.py b/src/tribler/gui/core_manager.py similarity index 96% rename from src/tribler-gui/tribler_gui/core_manager.py rename to src/tribler/gui/core_manager.py index 18cf95bfc37..f5830496cd9 100644 --- a/src/tribler-gui/tribler_gui/core_manager.py +++ b/src/tribler/gui/core_manager.py @@ -5,10 +5,10 @@ from PyQt5.QtNetwork import QNetworkRequest from PyQt5.QtWidgets import QApplication -from tribler_gui.event_request_manager import EventRequestManager -from tribler_gui.exceptions import CoreCrashedError -from tribler_gui.tribler_request_manager import TriblerNetworkRequest -from tribler_gui.utilities import connect +from tribler.gui.event_request_manager import EventRequestManager +from tribler.gui.exceptions import CoreCrashedError +from tribler.gui.tribler_request_manager import TriblerNetworkRequest +from tribler.gui.utilities import connect class CoreManager(QObject): diff --git a/src/tribler-gui/tribler_gui/debug_window.py b/src/tribler/gui/debug_window.py similarity index 98% rename from src/tribler-gui/tribler_gui/debug_window.py rename to src/tribler/gui/debug_window.py index 770c4e7eca6..d9ccb10ff2c 100644 --- a/src/tribler-gui/tribler_gui/debug_window.py +++ b/src/tribler/gui/debug_window.py @@ -17,16 +17,16 @@ import psutil -from tribler_core.utilities.utilities import has_bep33_support - -from tribler_gui.defs import DEBUG_PANE_REFRESH_TIMEOUT, GB, MB -from tribler_gui.dialogs.confirmationdialog import ConfirmationDialog -from tribler_gui.event_request_manager import received_events as tribler_received_events -from tribler_gui.resource_monitor import GuiResourceMonitor -from tribler_gui.tribler_request_manager import TriblerNetworkRequest, performed_requests as tribler_performed_requests -from tribler_gui.utilities import connect, format_size, get_ui_file_path -from tribler_gui.widgets.graphs.timeseriesplot import TimeSeriesPlot -from tribler_gui.widgets.ipv8health import MonitorWidget +from tribler.core.utilities.utilities import has_bep33_support + +from tribler.gui.defs import DEBUG_PANE_REFRESH_TIMEOUT, GB, MB +from tribler.gui.dialogs.confirmationdialog import ConfirmationDialog +from tribler.gui.event_request_manager import received_events as tribler_received_events +from tribler.gui.resource_monitor import GuiResourceMonitor +from tribler.gui.tribler_request_manager import TriblerNetworkRequest, performed_requests as tribler_performed_requests +from tribler.gui.utilities import connect, format_size, get_ui_file_path +from tribler.gui.widgets.graphs.timeseriesplot import TimeSeriesPlot +from tribler.gui.widgets.ipv8health import MonitorWidget COLOR_RGB_BLUE = (0, 153, 255) COLOR_WHITE_HEX = "#FFFFFF" diff --git a/src/tribler-gui/tribler_gui/defs.py b/src/tribler/gui/defs.py similarity index 100% rename from src/tribler-gui/tribler_gui/defs.py rename to src/tribler/gui/defs.py diff --git a/src/tribler-gui/tribler_gui/dialogs/__init__.py b/src/tribler/gui/dialogs/__init__.py similarity index 100% rename from src/tribler-gui/tribler_gui/dialogs/__init__.py rename to src/tribler/gui/dialogs/__init__.py diff --git a/src/tribler-gui/tribler_gui/dialogs/addtagsdialog.py b/src/tribler/gui/dialogs/addtagsdialog.py similarity index 89% rename from src/tribler-gui/tribler_gui/dialogs/addtagsdialog.py rename to src/tribler/gui/dialogs/addtagsdialog.py index c40bec7cb93..ac7cb41f397 100644 --- a/src/tribler-gui/tribler_gui/dialogs/addtagsdialog.py +++ b/src/tribler/gui/dialogs/addtagsdialog.py @@ -4,13 +4,13 @@ from PyQt5.QtCore import QModelIndex, QPoint, pyqtSignal from PyQt5.QtWidgets import QSizePolicy, QWidget -from tribler_core.components.tag.tag_constants import MAX_TAG_LENGTH, MIN_TAG_LENGTH +from tribler.core.components.tag.tag_constants import MAX_TAG_LENGTH, MIN_TAG_LENGTH -from tribler_gui.defs import TAG_HORIZONTAL_MARGIN -from tribler_gui.dialogs.dialogcontainer import DialogContainer -from tribler_gui.tribler_request_manager import TriblerNetworkRequest -from tribler_gui.utilities import connect, get_ui_file_path, tr -from tribler_gui.widgets.tagbutton import TagButton +from tribler.gui.defs import TAG_HORIZONTAL_MARGIN +from tribler.gui.dialogs.dialogcontainer import DialogContainer +from tribler.gui.tribler_request_manager import TriblerNetworkRequest +from tribler.gui.utilities import connect, get_ui_file_path, tr +from tribler.gui.widgets.tagbutton import TagButton class AddTagsDialog(DialogContainer): diff --git a/src/tribler-gui/tribler_gui/dialogs/addtopersonalchanneldialog.py b/src/tribler/gui/dialogs/addtopersonalchanneldialog.py similarity index 95% rename from src/tribler-gui/tribler_gui/dialogs/addtopersonalchanneldialog.py rename to src/tribler/gui/dialogs/addtopersonalchanneldialog.py index 554d1435854..6487018418e 100644 --- a/src/tribler-gui/tribler_gui/dialogs/addtopersonalchanneldialog.py +++ b/src/tribler/gui/dialogs/addtopersonalchanneldialog.py @@ -3,12 +3,12 @@ from PyQt5 import QtWidgets, uic from PyQt5.QtCore import pyqtSignal -from tribler_core.components.metadata_store.db.serialization import CHANNEL_TORRENT, COLLECTION_NODE +from tribler.core.components.metadata_store.db.serialization import CHANNEL_TORRENT, COLLECTION_NODE -from tribler_gui.dialogs.dialogcontainer import DialogContainer -from tribler_gui.dialogs.new_channel_dialog import NewChannelDialog -from tribler_gui.tribler_request_manager import TriblerNetworkRequest -from tribler_gui.utilities import connect, get_ui_file_path +from tribler.gui.dialogs.dialogcontainer import DialogContainer +from tribler.gui.dialogs.new_channel_dialog import NewChannelDialog +from tribler.gui.tribler_request_manager import TriblerNetworkRequest +from tribler.gui.utilities import connect, get_ui_file_path class ChannelQTreeWidgetItem(QtWidgets.QTreeWidgetItem): diff --git a/src/tribler-gui/tribler_gui/dialogs/confirmationdialog.py b/src/tribler/gui/dialogs/confirmationdialog.py similarity index 93% rename from src/tribler-gui/tribler_gui/dialogs/confirmationdialog.py rename to src/tribler/gui/dialogs/confirmationdialog.py index 978c3e83037..2ad57112ca6 100644 --- a/src/tribler-gui/tribler_gui/dialogs/confirmationdialog.py +++ b/src/tribler/gui/dialogs/confirmationdialog.py @@ -3,10 +3,10 @@ from PyQt5.QtGui import QCursor from PyQt5.QtWidgets import QSizePolicy, QSpacerItem -from tribler_gui.defs import BUTTON_TYPE_NORMAL -from tribler_gui.dialogs.dialogcontainer import DialogContainer -from tribler_gui.utilities import connect, get_ui_file_path, tr -from tribler_gui.widgets.ellipsebutton import EllipseButton +from tribler.gui.defs import BUTTON_TYPE_NORMAL +from tribler.gui.dialogs.dialogcontainer import DialogContainer +from tribler.gui.utilities import connect, get_ui_file_path, tr +from tribler.gui.widgets.ellipsebutton import EllipseButton class ConfirmationDialog(DialogContainer): diff --git a/src/tribler-gui/tribler_gui/dialogs/createtorrentdialog.py b/src/tribler/gui/dialogs/createtorrentdialog.py similarity index 94% rename from src/tribler-gui/tribler_gui/dialogs/createtorrentdialog.py rename to src/tribler/gui/dialogs/createtorrentdialog.py index 335e1d78f27..8cfd1febab6 100644 --- a/src/tribler-gui/tribler_gui/dialogs/createtorrentdialog.py +++ b/src/tribler/gui/dialogs/createtorrentdialog.py @@ -4,12 +4,12 @@ from PyQt5.QtCore import QDir, pyqtSignal from PyQt5.QtWidgets import QAction, QFileDialog, QSizePolicy, QTreeWidgetItem -from tribler_gui.defs import BUTTON_TYPE_NORMAL -from tribler_gui.dialogs.confirmationdialog import ConfirmationDialog -from tribler_gui.dialogs.dialogcontainer import DialogContainer -from tribler_gui.tribler_action_menu import TriblerActionMenu -from tribler_gui.tribler_request_manager import TriblerNetworkRequest -from tribler_gui.utilities import connect, get_ui_file_path, is_dir_writable, tr +from tribler.gui.defs import BUTTON_TYPE_NORMAL +from tribler.gui.dialogs.confirmationdialog import ConfirmationDialog +from tribler.gui.dialogs.dialogcontainer import DialogContainer +from tribler.gui.tribler_action_menu import TriblerActionMenu +from tribler.gui.tribler_request_manager import TriblerNetworkRequest +from tribler.gui.utilities import connect, get_ui_file_path, is_dir_writable, tr class DownloadFileTreeWidgetItem(QTreeWidgetItem): diff --git a/src/tribler-gui/tribler_gui/dialogs/dialogcontainer.py b/src/tribler/gui/dialogs/dialogcontainer.py similarity index 95% rename from src/tribler-gui/tribler_gui/dialogs/dialogcontainer.py rename to src/tribler/gui/dialogs/dialogcontainer.py index 80454e7eaad..18995383414 100644 --- a/src/tribler-gui/tribler_gui/dialogs/dialogcontainer.py +++ b/src/tribler/gui/dialogs/dialogcontainer.py @@ -4,8 +4,8 @@ from PyQt5.QtGui import QPainter from PyQt5.QtWidgets import QStyle, QStyleOption, QWidget -from tribler_gui.sentry_mixin import AddBreadcrumbOnShowMixin -from tribler_gui.utilities import connect +from tribler.gui.sentry_mixin import AddBreadcrumbOnShowMixin +from tribler.gui.utilities import connect class DialogContainer(AddBreadcrumbOnShowMixin, QWidget): diff --git a/src/tribler-gui/tribler_gui/dialogs/feedbackdialog.py b/src/tribler/gui/dialogs/feedbackdialog.py similarity index 92% rename from src/tribler-gui/tribler_gui/dialogs/feedbackdialog.py rename to src/tribler/gui/dialogs/feedbackdialog.py index 5e455bafbdf..7473dfceadf 100644 --- a/src/tribler-gui/tribler_gui/dialogs/feedbackdialog.py +++ b/src/tribler/gui/dialogs/feedbackdialog.py @@ -8,16 +8,16 @@ from PyQt5 import uic from PyQt5.QtWidgets import QAction, QApplication, QDialog, QMessageBox, QTreeWidgetItem -from tribler_core.components.reporter.reported_error import ReportedError -from tribler_core.sentry_reporter.sentry_reporter import SentryReporter -from tribler_core.sentry_reporter.sentry_scrubber import SentryScrubber -from tribler_core.sentry_reporter.sentry_tools import CONTEXT_DELIMITER, LONG_TEXT_DELIMITER - -from tribler_gui.event_request_manager import received_events -from tribler_gui.sentry_mixin import AddBreadcrumbOnShowMixin -from tribler_gui.tribler_action_menu import TriblerActionMenu -from tribler_gui.tribler_request_manager import performed_requests as tribler_performed_requests -from tribler_gui.utilities import connect, get_ui_file_path, tr +from tribler.core.components.reporter.reported_error import ReportedError +from tribler.core.sentry_reporter.sentry_reporter import SentryReporter +from tribler.core.sentry_reporter.sentry_scrubber import SentryScrubber +from tribler.core.sentry_reporter.sentry_tools import CONTEXT_DELIMITER, LONG_TEXT_DELIMITER + +from tribler.gui.event_request_manager import received_events +from tribler.gui.sentry_mixin import AddBreadcrumbOnShowMixin +from tribler.gui.tribler_action_menu import TriblerActionMenu +from tribler.gui.tribler_request_manager import performed_requests as tribler_performed_requests +from tribler.gui.utilities import connect, get_ui_file_path, tr class FeedbackDialog(AddBreadcrumbOnShowMixin, QDialog): diff --git a/src/tribler-gui/tribler_gui/dialogs/new_channel_dialog.py b/src/tribler/gui/dialogs/new_channel_dialog.py similarity index 87% rename from src/tribler-gui/tribler_gui/dialogs/new_channel_dialog.py rename to src/tribler/gui/dialogs/new_channel_dialog.py index 8c1e87f3462..8df7b94a8a6 100644 --- a/src/tribler-gui/tribler_gui/dialogs/new_channel_dialog.py +++ b/src/tribler/gui/dialogs/new_channel_dialog.py @@ -1,6 +1,6 @@ -from tribler_gui.defs import BUTTON_TYPE_CONFIRM, BUTTON_TYPE_NORMAL -from tribler_gui.dialogs.confirmationdialog import ConfirmationDialog -from tribler_gui.utilities import connect, tr +from tribler.gui.defs import BUTTON_TYPE_CONFIRM, BUTTON_TYPE_NORMAL +from tribler.gui.dialogs.confirmationdialog import ConfirmationDialog +from tribler.gui.utilities import connect, tr class NewChannelDialog(ConfirmationDialog): diff --git a/src/tribler-gui/tribler_gui/dialogs/startdownloaddialog.py b/src/tribler/gui/dialogs/startdownloaddialog.py similarity index 96% rename from src/tribler-gui/tribler_gui/dialogs/startdownloaddialog.py rename to src/tribler/gui/dialogs/startdownloaddialog.py index edf23861a23..8e1f42b19b6 100644 --- a/src/tribler-gui/tribler_gui/dialogs/startdownloaddialog.py +++ b/src/tribler/gui/dialogs/startdownloaddialog.py @@ -8,13 +8,13 @@ from PyQt5.QtCore import QTimer, pyqtSignal from PyQt5.QtWidgets import QFileDialog, QSizePolicy -from tribler_core.utilities.rest_utils import FILE_SCHEME, MAGNET_SCHEME, scheme_from_uri, uri_to_path +from tribler.core.utilities.rest_utils import FILE_SCHEME, MAGNET_SCHEME, scheme_from_uri, uri_to_path -from tribler_gui.defs import METAINFO_MAX_RETRIES, METAINFO_TIMEOUT -from tribler_gui.dialogs.confirmationdialog import ConfirmationDialog -from tribler_gui.dialogs.dialogcontainer import DialogContainer -from tribler_gui.tribler_request_manager import TriblerNetworkRequest -from tribler_gui.utilities import ( +from tribler.gui.defs import METAINFO_MAX_RETRIES, METAINFO_TIMEOUT +from tribler.gui.dialogs.confirmationdialog import ConfirmationDialog +from tribler.gui.dialogs.dialogcontainer import DialogContainer +from tribler.gui.tribler_request_manager import TriblerNetworkRequest +from tribler.gui.utilities import ( connect, format_size, get_gui_setting, @@ -23,7 +23,7 @@ is_dir_writable, tr, ) -from tribler_gui.widgets.torrentfiletreewidget import TORRENT_FILES_TREE_STYLESHEET +from tribler.gui.widgets.torrentfiletreewidget import TORRENT_FILES_TREE_STYLESHEET class StartDownloadDialog(DialogContainer): diff --git a/src/tribler-gui/tribler_gui/dialogs/trustexplanationdialog.py b/src/tribler/gui/dialogs/trustexplanationdialog.py similarity index 82% rename from src/tribler-gui/tribler_gui/dialogs/trustexplanationdialog.py rename to src/tribler/gui/dialogs/trustexplanationdialog.py index 7ddcca91a23..7c35fdabfde 100644 --- a/src/tribler-gui/tribler_gui/dialogs/trustexplanationdialog.py +++ b/src/tribler/gui/dialogs/trustexplanationdialog.py @@ -1,8 +1,8 @@ from PyQt5 import uic from PyQt5.QtWidgets import QSizePolicy -from tribler_gui.dialogs.dialogcontainer import DialogContainer -from tribler_gui.utilities import connect, get_ui_file_path +from tribler.gui.dialogs.dialogcontainer import DialogContainer +from tribler.gui.utilities import connect, get_ui_file_path class TrustExplanationDialog(DialogContainer): diff --git a/src/tribler-gui/tribler_gui/error_handler.py b/src/tribler/gui/error_handler.py similarity index 92% rename from src/tribler-gui/tribler_gui/error_handler.py rename to src/tribler/gui/error_handler.py index 405e2d412be..48db14f10e2 100644 --- a/src/tribler-gui/tribler_gui/error_handler.py +++ b/src/tribler/gui/error_handler.py @@ -1,12 +1,12 @@ import logging import traceback -from tribler_core.components.reporter.reported_error import ReportedError -from tribler_core.sentry_reporter.sentry_reporter import SentryStrategy +from tribler.core.components.reporter.reported_error import ReportedError +from tribler.core.sentry_reporter.sentry_reporter import SentryStrategy -from tribler_gui import gui_sentry_reporter -from tribler_gui.dialogs.feedbackdialog import FeedbackDialog -from tribler_gui.exceptions import CoreError +from tribler.gui import gui_sentry_reporter +from tribler.gui.dialogs.feedbackdialog import FeedbackDialog +from tribler.gui.exceptions import CoreError # fmt: off diff --git a/src/tribler-gui/tribler_gui/event_request_manager.py b/src/tribler/gui/event_request_manager.py similarity index 95% rename from src/tribler-gui/tribler_gui/event_request_manager.py rename to src/tribler/gui/event_request_manager.py index 45cee811ead..99ec3643626 100644 --- a/src/tribler-gui/tribler_gui/event_request_manager.py +++ b/src/tribler/gui/event_request_manager.py @@ -5,13 +5,13 @@ from PyQt5.QtCore import QTimer, QUrl, pyqtSignal from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkReply, QNetworkRequest -from tribler_core import notifications -from tribler_core.components.reporter.reported_error import ReportedError -from tribler_core.utilities.notifier import Notifier +from tribler.core import notifications +from tribler.core.components.reporter.reported_error import ReportedError +from tribler.core.utilities.notifier import Notifier -from tribler_gui import gui_sentry_reporter -from tribler_gui.exceptions import CoreConnectTimeoutError, CoreConnectionError -from tribler_gui.utilities import connect +from tribler.gui import gui_sentry_reporter +from tribler.gui.exceptions import CoreConnectTimeoutError, CoreConnectionError +from tribler.gui.utilities import connect received_events = [] diff --git a/src/tribler-gui/tribler_gui/exceptions.py b/src/tribler/gui/exceptions.py similarity index 100% rename from src/tribler-gui/tribler_gui/exceptions.py rename to src/tribler/gui/exceptions.py diff --git a/src/tribler-gui/tribler_gui/i18n/README.md b/src/tribler/gui/i18n/README.md similarity index 100% rename from src/tribler-gui/tribler_gui/i18n/README.md rename to src/tribler/gui/i18n/README.md diff --git a/src/tribler-gui/tribler_gui/i18n/extract-messages.sh b/src/tribler/gui/i18n/extract-messages.sh similarity index 100% rename from src/tribler-gui/tribler_gui/i18n/extract-messages.sh rename to src/tribler/gui/i18n/extract-messages.sh diff --git a/src/tribler-gui/tribler_gui/i18n/pt_BR.qm b/src/tribler/gui/i18n/pt_BR.qm similarity index 100% rename from src/tribler-gui/tribler_gui/i18n/pt_BR.qm rename to src/tribler/gui/i18n/pt_BR.qm diff --git a/src/tribler-gui/tribler_gui/i18n/pt_BR.ts b/src/tribler/gui/i18n/pt_BR.ts similarity index 100% rename from src/tribler-gui/tribler_gui/i18n/pt_BR.ts rename to src/tribler/gui/i18n/pt_BR.ts diff --git a/src/tribler-gui/tribler_gui/i18n/ru_RU.qm b/src/tribler/gui/i18n/ru_RU.qm similarity index 100% rename from src/tribler-gui/tribler_gui/i18n/ru_RU.qm rename to src/tribler/gui/i18n/ru_RU.qm diff --git a/src/tribler-gui/tribler_gui/i18n/ru_RU.ts b/src/tribler/gui/i18n/ru_RU.ts similarity index 100% rename from src/tribler-gui/tribler_gui/i18n/ru_RU.ts rename to src/tribler/gui/i18n/ru_RU.ts diff --git a/src/tribler-gui/tribler_gui/i18n/update_translations.sh b/src/tribler/gui/i18n/update_translations.sh similarity index 100% rename from src/tribler-gui/tribler_gui/i18n/update_translations.sh rename to src/tribler/gui/i18n/update_translations.sh diff --git a/src/tribler-gui/tribler_gui/i18n/zh_CN.qm b/src/tribler/gui/i18n/zh_CN.qm similarity index 100% rename from src/tribler-gui/tribler_gui/i18n/zh_CN.qm rename to src/tribler/gui/i18n/zh_CN.qm diff --git a/src/tribler-gui/tribler_gui/i18n/zh_CN.ts b/src/tribler/gui/i18n/zh_CN.ts similarity index 100% rename from src/tribler-gui/tribler_gui/i18n/zh_CN.ts rename to src/tribler/gui/i18n/zh_CN.ts diff --git a/src/tribler-gui/tribler_gui/images/add.png b/src/tribler/gui/images/add.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/add.png rename to src/tribler/gui/images/add.png diff --git a/src/tribler-gui/tribler_gui/images/bitcoin.png b/src/tribler/gui/images/bitcoin.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/bitcoin.png rename to src/tribler/gui/images/bitcoin.png diff --git a/src/tribler-gui/tribler_gui/images/browse_folder.svg b/src/tribler/gui/images/browse_folder.svg similarity index 100% rename from src/tribler-gui/tribler_gui/images/browse_folder.svg rename to src/tribler/gui/images/browse_folder.svg diff --git a/src/tribler-gui/tribler_gui/images/buffering_animation.svg b/src/tribler/gui/images/buffering_animation.svg similarity index 100% rename from src/tribler-gui/tribler_gui/images/buffering_animation.svg rename to src/tribler/gui/images/buffering_animation.svg diff --git a/src/tribler-gui/tribler_gui/images/chan_thumb.png b/src/tribler/gui/images/chan_thumb.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/chan_thumb.png rename to src/tribler/gui/images/chan_thumb.png diff --git a/src/tribler-gui/tribler_gui/images/check.svg b/src/tribler/gui/images/check.svg similarity index 100% rename from src/tribler-gui/tribler_gui/images/check.svg rename to src/tribler/gui/images/check.svg diff --git a/src/tribler-gui/tribler_gui/images/checked-no.png b/src/tribler/gui/images/checked-no.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/checked-no.png rename to src/tribler/gui/images/checked-no.png diff --git a/src/tribler-gui/tribler_gui/images/checked-yes.png b/src/tribler/gui/images/checked-yes.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/checked-yes.png rename to src/tribler/gui/images/checked-yes.png diff --git a/src/tribler-gui/tribler_gui/images/copy.png b/src/tribler/gui/images/copy.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/copy.png rename to src/tribler/gui/images/copy.png diff --git a/src/tribler-gui/tribler_gui/images/credit_mining_not.png b/src/tribler/gui/images/credit_mining_not.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/credit_mining_not.png rename to src/tribler/gui/images/credit_mining_not.png diff --git a/src/tribler-gui/tribler_gui/images/credit_mining_yes.png b/src/tribler/gui/images/credit_mining_yes.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/credit_mining_yes.png rename to src/tribler/gui/images/credit_mining_yes.png diff --git a/src/tribler-gui/tribler_gui/images/debug.png b/src/tribler/gui/images/debug.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/debug.png rename to src/tribler/gui/images/debug.png diff --git a/src/tribler-gui/tribler_gui/images/default-placeholder.png b/src/tribler/gui/images/default-placeholder.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/default-placeholder.png rename to src/tribler/gui/images/default-placeholder.png diff --git a/src/tribler-gui/tribler_gui/images/delete.png b/src/tribler/gui/images/delete.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/delete.png rename to src/tribler/gui/images/delete.png diff --git a/src/tribler-gui/tribler_gui/images/dialog_close.png b/src/tribler/gui/images/dialog_close.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/dialog_close.png rename to src/tribler/gui/images/dialog_close.png diff --git a/src/tribler-gui/tribler_gui/images/discovered.png b/src/tribler/gui/images/discovered.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/discovered.png rename to src/tribler/gui/images/discovered.png diff --git a/src/tribler-gui/tribler_gui/images/discovering_animation.svg b/src/tribler/gui/images/discovering_animation.svg similarity index 100% rename from src/tribler-gui/tribler_gui/images/discovering_animation.svg rename to src/tribler/gui/images/discovering_animation.svg diff --git a/src/tribler-gui/tribler_gui/images/down_arrow.png b/src/tribler/gui/images/down_arrow.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/down_arrow.png rename to src/tribler/gui/images/down_arrow.png diff --git a/src/tribler-gui/tribler_gui/images/down_arrow_input.png b/src/tribler/gui/images/down_arrow_input.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/down_arrow_input.png rename to src/tribler/gui/images/down_arrow_input.png diff --git a/src/tribler-gui/tribler_gui/images/downloads.png b/src/tribler/gui/images/downloads.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/downloads.png rename to src/tribler/gui/images/downloads.png diff --git a/src/tribler-gui/tribler_gui/images/edit.png b/src/tribler/gui/images/edit.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/edit.png rename to src/tribler/gui/images/edit.png diff --git a/src/tribler-gui/tribler_gui/images/edit_orange.png b/src/tribler/gui/images/edit_orange.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/edit_orange.png rename to src/tribler/gui/images/edit_orange.png diff --git a/src/tribler-gui/tribler_gui/images/edit_white.png b/src/tribler/gui/images/edit_white.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/edit_white.png rename to src/tribler/gui/images/edit_white.png diff --git a/src/tribler-gui/tribler_gui/images/ellipsis.png b/src/tribler/gui/images/ellipsis.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/ellipsis.png rename to src/tribler/gui/images/ellipsis.png diff --git a/src/tribler-gui/tribler_gui/images/fire.png b/src/tribler/gui/images/fire.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/fire.png rename to src/tribler/gui/images/fire.png diff --git a/src/tribler-gui/tribler_gui/images/full_screen.png b/src/tribler/gui/images/full_screen.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/full_screen.png rename to src/tribler/gui/images/full_screen.png diff --git a/src/tribler-gui/tribler_gui/images/gear.png b/src/tribler/gui/images/gear.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/gear.png rename to src/tribler/gui/images/gear.png diff --git a/src/tribler-gui/tribler_gui/images/history.png b/src/tribler/gui/images/history.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/history.png rename to src/tribler/gui/images/history.png diff --git a/src/tribler-gui/tribler_gui/images/home.png b/src/tribler/gui/images/home.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/home.png rename to src/tribler/gui/images/home.png diff --git a/src/tribler-gui/tribler_gui/images/info.png b/src/tribler/gui/images/info.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/info.png rename to src/tribler/gui/images/info.png diff --git a/src/tribler-gui/tribler_gui/images/loading_animation.svg b/src/tribler/gui/images/loading_animation.svg similarity index 100% rename from src/tribler-gui/tribler_gui/images/loading_animation.svg rename to src/tribler/gui/images/loading_animation.svg diff --git a/src/tribler-gui/tribler_gui/images/magnet.png b/src/tribler/gui/images/magnet.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/magnet.png rename to src/tribler/gui/images/magnet.png diff --git a/src/tribler-gui/tribler_gui/images/menu.png b/src/tribler/gui/images/menu.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/menu.png rename to src/tribler/gui/images/menu.png diff --git a/src/tribler-gui/tribler_gui/images/menu_white.png b/src/tribler/gui/images/menu_white.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/menu_white.png rename to src/tribler/gui/images/menu_white.png diff --git a/src/tribler-gui/tribler_gui/images/minus.svg b/src/tribler/gui/images/minus.svg similarity index 100% rename from src/tribler-gui/tribler_gui/images/minus.svg rename to src/tribler/gui/images/minus.svg diff --git a/src/tribler-gui/tribler_gui/images/monochrome_tribler.png b/src/tribler/gui/images/monochrome_tribler.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/monochrome_tribler.png rename to src/tribler/gui/images/monochrome_tribler.png diff --git a/src/tribler-gui/tribler_gui/images/network.png b/src/tribler/gui/images/network.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/network.png rename to src/tribler/gui/images/network.png diff --git a/src/tribler-gui/tribler_gui/images/page_back.png b/src/tribler/gui/images/page_back.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/page_back.png rename to src/tribler/gui/images/page_back.png diff --git a/src/tribler-gui/tribler_gui/images/pause.png b/src/tribler/gui/images/pause.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/pause.png rename to src/tribler/gui/images/pause.png diff --git a/src/tribler-gui/tribler_gui/images/play.png b/src/tribler/gui/images/play.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/play.png rename to src/tribler/gui/images/play.png diff --git a/src/tribler-gui/tribler_gui/images/playlist_items.png b/src/tribler/gui/images/playlist_items.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/playlist_items.png rename to src/tribler/gui/images/playlist_items.png diff --git a/src/tribler-gui/tribler_gui/images/plus.svg b/src/tribler/gui/images/plus.svg similarity index 100% rename from src/tribler-gui/tribler_gui/images/plus.svg rename to src/tribler/gui/images/plus.svg diff --git a/src/tribler-gui/tribler_gui/images/portfolio.png b/src/tribler/gui/images/portfolio.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/portfolio.png rename to src/tribler/gui/images/portfolio.png diff --git a/src/tribler-gui/tribler_gui/images/refresh.png b/src/tribler/gui/images/refresh.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/refresh.png rename to src/tribler/gui/images/refresh.png diff --git a/src/tribler-gui/tribler_gui/images/search.png b/src/tribler/gui/images/search.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/search.png rename to src/tribler/gui/images/search.png diff --git a/src/tribler-gui/tribler_gui/images/share.png b/src/tribler/gui/images/share.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/share.png rename to src/tribler/gui/images/share.png diff --git a/src/tribler-gui/tribler_gui/images/spinner.gif b/src/tribler/gui/images/spinner.gif similarity index 100% rename from src/tribler-gui/tribler_gui/images/spinner.gif rename to src/tribler/gui/images/spinner.gif diff --git a/src/tribler-gui/tribler_gui/images/stop.png b/src/tribler/gui/images/stop.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/stop.png rename to src/tribler/gui/images/stop.png diff --git a/src/tribler-gui/tribler_gui/images/subscribed.png b/src/tribler/gui/images/subscribed.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/subscribed.png rename to src/tribler/gui/images/subscribed.png diff --git a/src/tribler-gui/tribler_gui/images/subscribed_not.png b/src/tribler/gui/images/subscribed_not.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/subscribed_not.png rename to src/tribler/gui/images/subscribed_not.png diff --git a/src/tribler-gui/tribler_gui/images/subscribed_yes.png b/src/tribler/gui/images/subscribed_yes.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/subscribed_yes.png rename to src/tribler/gui/images/subscribed_yes.png diff --git a/src/tribler-gui/tribler_gui/images/toggle-checked-disabled.svg b/src/tribler/gui/images/toggle-checked-disabled.svg similarity index 100% rename from src/tribler-gui/tribler_gui/images/toggle-checked-disabled.svg rename to src/tribler/gui/images/toggle-checked-disabled.svg diff --git a/src/tribler-gui/tribler_gui/images/toggle-checked.svg b/src/tribler/gui/images/toggle-checked.svg similarity index 100% rename from src/tribler-gui/tribler_gui/images/toggle-checked.svg rename to src/tribler/gui/images/toggle-checked.svg diff --git a/src/tribler-gui/tribler_gui/images/toggle-unchecked-disabled.svg b/src/tribler/gui/images/toggle-unchecked-disabled.svg similarity index 100% rename from src/tribler-gui/tribler_gui/images/toggle-unchecked-disabled.svg rename to src/tribler/gui/images/toggle-unchecked-disabled.svg diff --git a/src/tribler-gui/tribler_gui/images/toggle-unchecked.svg b/src/tribler/gui/images/toggle-unchecked.svg similarity index 100% rename from src/tribler-gui/tribler_gui/images/toggle-unchecked.svg rename to src/tribler/gui/images/toggle-unchecked.svg diff --git a/src/tribler-gui/tribler_gui/images/toggle-undefined.svg b/src/tribler/gui/images/toggle-undefined.svg similarity index 100% rename from src/tribler-gui/tribler_gui/images/toggle-undefined.svg rename to src/tribler/gui/images/toggle-undefined.svg diff --git a/src/tribler-gui/tribler_gui/images/trash.svg b/src/tribler/gui/images/trash.svg similarity index 100% rename from src/tribler-gui/tribler_gui/images/trash.svg rename to src/tribler/gui/images/trash.svg diff --git a/src/tribler-gui/tribler_gui/images/tribler.png b/src/tribler/gui/images/tribler.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/tribler.png rename to src/tribler/gui/images/tribler.png diff --git a/src/tribler-gui/tribler_gui/images/undo.svg b/src/tribler/gui/images/undo.svg similarity index 100% rename from src/tribler-gui/tribler_gui/images/undo.svg rename to src/tribler/gui/images/undo.svg diff --git a/src/tribler-gui/tribler_gui/images/update.svg b/src/tribler/gui/images/update.svg similarity index 100% rename from src/tribler-gui/tribler_gui/images/update.svg rename to src/tribler/gui/images/update.svg diff --git a/src/tribler-gui/tribler_gui/images/video.png b/src/tribler/gui/images/video.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/video.png rename to src/tribler/gui/images/video.png diff --git a/src/tribler-gui/tribler_gui/images/volume_off.png b/src/tribler/gui/images/volume_off.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/volume_off.png rename to src/tribler/gui/images/volume_off.png diff --git a/src/tribler-gui/tribler_gui/images/volume_on.png b/src/tribler/gui/images/volume_on.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/volume_on.png rename to src/tribler/gui/images/volume_on.png diff --git a/src/tribler-gui/tribler_gui/images/wait.png b/src/tribler/gui/images/wait.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/wait.png rename to src/tribler/gui/images/wait.png diff --git a/src/tribler-gui/tribler_gui/images/wait_animation.svg b/src/tribler/gui/images/wait_animation.svg similarity index 100% rename from src/tribler-gui/tribler_gui/images/wait_animation.svg rename to src/tribler/gui/images/wait_animation.svg diff --git a/src/tribler-gui/tribler_gui/images/wallet.png b/src/tribler/gui/images/wallet.png similarity index 100% rename from src/tribler-gui/tribler_gui/images/wallet.png rename to src/tribler/gui/images/wallet.png diff --git a/src/tribler-gui/tribler_gui/qt_resources/add_tags_dialog.ui b/src/tribler/gui/qt_resources/add_tags_dialog.ui similarity index 99% rename from src/tribler-gui/tribler_gui/qt_resources/add_tags_dialog.ui rename to src/tribler/gui/qt_resources/add_tags_dialog.ui index af78e6f86a5..b253f2a8fcf 100644 --- a/src/tribler-gui/tribler_gui/qt_resources/add_tags_dialog.ui +++ b/src/tribler/gui/qt_resources/add_tags_dialog.ui @@ -481,7 +481,7 @@ margin-top: 4px; TagsLineEdit QLineEdit -
tribler_gui.widgets.tagslineedit.h
+
tribler.gui.widgets.tagslineedit.h
diff --git a/src/tribler-gui/tribler_gui/qt_resources/addtochanneldialog.ui b/src/tribler/gui/qt_resources/addtochanneldialog.ui similarity index 100% rename from src/tribler-gui/tribler_gui/qt_resources/addtochanneldialog.ui rename to src/tribler/gui/qt_resources/addtochanneldialog.ui diff --git a/src/tribler-gui/tribler_gui/qt_resources/buttonsdialog.ui b/src/tribler/gui/qt_resources/buttonsdialog.ui similarity index 100% rename from src/tribler-gui/tribler_gui/qt_resources/buttonsdialog.ui rename to src/tribler/gui/qt_resources/buttonsdialog.ui diff --git a/src/tribler-gui/tribler_gui/qt_resources/channel_description.ui b/src/tribler/gui/qt_resources/channel_description.ui similarity index 98% rename from src/tribler-gui/tribler_gui/qt_resources/channel_description.ui rename to src/tribler/gui/qt_resources/channel_description.ui index a9aa435cebe..2e60ec319c1 100644 --- a/src/tribler-gui/tribler_gui/qt_resources/channel_description.ui +++ b/src/tribler/gui/qt_resources/channel_description.ui @@ -368,17 +368,17 @@ ClickableLabel QLabel -
tribler_gui.widgets.clickablewidgets.h
+
tribler.gui.widgets.clickablewidgets.h
UnderlineTabButton QToolButton -
tribler_gui.widgets.underlinetabbutton.h
+
tribler.gui.widgets.underlinetabbutton.h
TabButtonPanel QWidget -
tribler_gui.widgets.tabbuttonpanel.h
+
tribler.gui.widgets.tabbuttonpanel.h
1
diff --git a/src/tribler-gui/tribler_gui/qt_resources/createtorrentdialog.ui b/src/tribler/gui/qt_resources/createtorrentdialog.ui similarity index 100% rename from src/tribler-gui/tribler_gui/qt_resources/createtorrentdialog.ui rename to src/tribler/gui/qt_resources/createtorrentdialog.ui diff --git a/src/tribler-gui/tribler_gui/qt_resources/debugwindow.ui b/src/tribler/gui/qt_resources/debugwindow.ui similarity index 100% rename from src/tribler-gui/tribler_gui/qt_resources/debugwindow.ui rename to src/tribler/gui/qt_resources/debugwindow.ui diff --git a/src/tribler-gui/tribler_gui/qt_resources/feedback_dialog.ui b/src/tribler/gui/qt_resources/feedback_dialog.ui similarity index 99% rename from src/tribler-gui/tribler_gui/qt_resources/feedback_dialog.ui rename to src/tribler/gui/qt_resources/feedback_dialog.ui index fc77c528311..a2c0ec38cc3 100644 --- a/src/tribler-gui/tribler_gui/qt_resources/feedback_dialog.ui +++ b/src/tribler/gui/qt_resources/feedback_dialog.ui @@ -403,7 +403,7 @@ background-color: #303030; EllipseButton QToolButton -
tribler_gui.widgets.ellipsebutton.h
+
tribler.gui.widgets.ellipsebutton.h
diff --git a/src/tribler-gui/tribler_gui/qt_resources/loading_list_item.ui b/src/tribler/gui/qt_resources/loading_list_item.ui similarity index 100% rename from src/tribler-gui/tribler_gui/qt_resources/loading_list_item.ui rename to src/tribler/gui/qt_resources/loading_list_item.ui diff --git a/src/tribler-gui/tribler_gui/qt_resources/mainwindow.ui b/src/tribler/gui/qt_resources/mainwindow.ui similarity index 99% rename from src/tribler-gui/tribler_gui/qt_resources/mainwindow.ui rename to src/tribler/gui/qt_resources/mainwindow.ui index 0e6a17afd83..2ad358bb6a0 100644 --- a/src/tribler-gui/tribler_gui/qt_resources/mainwindow.ui +++ b/src/tribler/gui/qt_resources/mainwindow.ui @@ -5612,96 +5612,96 @@ background: none; TorrentFileTreeWidget QTreeWidget -
tribler_gui.widgets.torrentfiletreewidget.h
+
tribler.gui.widgets.torrentfiletreewidget.h
EllipseButton QToolButton -
tribler_gui.widgets.ellipsebutton.h
+
tribler.gui.widgets.ellipsebutton.h
UnderlineTabButton QToolButton -
tribler_gui.widgets.underlinetabbutton.h
+
tribler.gui.widgets.underlinetabbutton.h
TabButtonPanel QWidget -
tribler_gui.widgets.tabbuttonpanel.h
+
tribler.gui.widgets.tabbuttonpanel.h
1
SettingsPage QWidget -
tribler_gui.widgets.settingspage.h
+
tribler.gui.widgets.settingspage.h
1
DownloadsPage QWidget -
tribler_gui.widgets.downloadspage.h
+
tribler.gui.widgets.downloadspage.h
1
DownloadsDetailsTabWidget QTabWidget -
tribler_gui.widgets.downloadsdetailstabwidget.h
+
tribler.gui.widgets.downloadsdetailstabwidget.h
1
LoadingPage QWidget -
tribler_gui.widgets.loadingpage.h
+
tribler.gui.widgets.loadingpage.h
1
DiscoveringPage QWidget -
tribler_gui.widgets.discoveringpage.h
+
tribler.gui.widgets.discoveringpage.h
1
CircleButton QToolButton -
tribler_gui.widgets.circlebutton.h
+
tribler.gui.widgets.circlebutton.h
DownloadProgressBar QWidget -
tribler_gui.widgets.downloadprogressbar.h
+
tribler.gui.widgets.downloadprogressbar.h
1
TrustPage QWidget -
tribler_gui.widgets.trustpage.h
+
tribler.gui.widgets.trustpage.h
1
ChannelContentsWidget QWidget -
tribler_gui.widgets.channelcontentswidget.h
+
tribler.gui.widgets.channelcontentswidget.h
TrustGraphPage QWidget -
tribler_gui.widgets.trustgraphpage.h
+
tribler.gui.widgets.trustgraphpage.h
1
ClickableLineEdit QLineEdit -
tribler_gui.widgets.clickable_line_edit.h
+
tribler.gui.widgets.clickable_line_edit.h
ChannelsMenuListWidget QListWidget -
tribler_gui.widgets.channelsmenulistwidget.h
+
tribler.gui.widgets.channelsmenulistwidget.h
SearchResultsWidget QWidget -
tribler_gui.widgets.searchresultswidget.h
+
tribler.gui.widgets.searchresultswidget.h
diff --git a/src/tribler-gui/tribler_gui/qt_resources/qtbug.ui b/src/tribler/gui/qt_resources/qtbug.ui similarity index 87% rename from src/tribler-gui/tribler_gui/qt_resources/qtbug.ui rename to src/tribler/gui/qt_resources/qtbug.ui index 5039cf8cbec..ab6e6c0c23c 100644 --- a/src/tribler-gui/tribler_gui/qt_resources/qtbug.ui +++ b/src/tribler/gui/qt_resources/qtbug.ui @@ -7,7 +7,7 @@ QtBug QWidget -
tribler_gui.widgets.qtbug.h
+
tribler.gui.widgets.qtbug.h
0
diff --git a/src/tribler-gui/tribler_gui/qt_resources/search_results.ui b/src/tribler/gui/qt_resources/search_results.ui similarity index 95% rename from src/tribler-gui/tribler_gui/qt_resources/search_results.ui rename to src/tribler/gui/qt_resources/search_results.ui index c345cb8af5e..7ef8639c575 100644 --- a/src/tribler-gui/tribler_gui/qt_resources/search_results.ui +++ b/src/tribler/gui/qt_resources/search_results.ui @@ -116,17 +116,17 @@ EllipseButton QToolButton -
tribler_gui.widgets.ellipsebutton.h
+
tribler.gui.widgets.ellipsebutton.h
ChannelContentsWidget QWidget -
tribler_gui.widgets.channelcontentswidget.h
+
tribler.gui.widgets.channelcontentswidget.h
TimeoutProgressBar QProgressBar -
tribler_gui.widgets.timeoutprogressbar.h
+
tribler.gui.widgets.timeoutprogressbar.h
1
diff --git a/src/tribler-gui/tribler_gui/qt_resources/startdownloaddialog.ui b/src/tribler/gui/qt_resources/startdownloaddialog.ui similarity index 99% rename from src/tribler-gui/tribler_gui/qt_resources/startdownloaddialog.ui rename to src/tribler/gui/qt_resources/startdownloaddialog.ui index d7ac1792a94..ca6cf04f20e 100644 --- a/src/tribler-gui/tribler_gui/qt_resources/startdownloaddialog.ui +++ b/src/tribler/gui/qt_resources/startdownloaddialog.ui @@ -560,12 +560,12 @@ background: yellow; ClickableLabel QLabel -
tribler_gui.widgets.clickablewidgets.h
+
tribler.gui.widgets.clickablewidgets.h
TorrentFileTreeWidget QTreeWidget -
tribler_gui.widgets.torrentfiletreewidget.h
+
tribler.gui.widgets.torrentfiletreewidget.h
diff --git a/src/tribler-gui/tribler_gui/qt_resources/torrents_list.ui b/src/tribler/gui/qt_resources/torrents_list.ui similarity index 98% rename from src/tribler-gui/tribler_gui/qt_resources/torrents_list.ui rename to src/tribler/gui/qt_resources/torrents_list.ui index 08826e8f5b0..9561a474a9c 100644 --- a/src/tribler-gui/tribler_gui/qt_resources/torrents_list.ui +++ b/src/tribler/gui/qt_resources/torrents_list.ui @@ -838,39 +838,39 @@ QTableView::item::hover { EllipseButton QToolButton -
tribler_gui.widgets.ellipsebutton.h
+
tribler.gui.widgets.ellipsebutton.h
QtBug QWidget -
tribler_gui.widgets.qtbug.h
+
tribler.gui.widgets.qtbug.h
1
SubscriptionsWidget QWidget -
tribler_gui.widgets.subscriptionswidget.h
+
tribler.gui.widgets.subscriptionswidget.h
1
TriblerContentTableView QTableView -
tribler_gui.widgets.lazytableview.h
+
tribler.gui.widgets.lazytableview.h
ToggleButton QWidget -
tribler_gui.widgets.togglebutton.h
+
tribler.gui.widgets.togglebutton.h
ChannelDescriptionWidget QWidget -
tribler_gui.widgets.channeldescriptionwidget.h
+
tribler.gui.widgets.channeldescriptionwidget.h
InstantTooltipButton QToolButton -
tribler_gui.widgets.instanttooltipbutton.h
+
tribler.gui.widgets.instanttooltipbutton.h
diff --git a/src/tribler-gui/tribler_gui/qt_resources/trustexplanation.ui b/src/tribler/gui/qt_resources/trustexplanation.ui similarity index 100% rename from src/tribler-gui/tribler_gui/qt_resources/trustexplanation.ui rename to src/tribler/gui/qt_resources/trustexplanation.ui diff --git a/src/tribler-gui/tribler_gui/resource_monitor.py b/src/tribler/gui/resource_monitor.py similarity index 95% rename from src/tribler-gui/tribler_gui/resource_monitor.py rename to src/tribler/gui/resource_monitor.py index 4ecc9c9ad3f..59985d7a0b7 100644 --- a/src/tribler-gui/tribler_gui/resource_monitor.py +++ b/src/tribler/gui/resource_monitor.py @@ -1,7 +1,7 @@ from PyQt5.QtCore import QTimer from PyQt5.QtWidgets import QWidget -from tribler_core.components.resource_monitor.implementation.base import ResourceMonitor +from tribler.core.components.resource_monitor.implementation.base import ResourceMonitor GUI_RESOURCE_CHECK_INTERVAL = 5000 # milliseconds GUI_RESOURCE_HISTORY_SIZE = 1000 diff --git a/src/tribler-gui/tribler_gui/sentry_mixin.py b/src/tribler/gui/sentry_mixin.py similarity index 88% rename from src/tribler-gui/tribler_gui/sentry_mixin.py rename to src/tribler/gui/sentry_mixin.py index 4486e069800..433e88c6333 100644 --- a/src/tribler-gui/tribler_gui/sentry_mixin.py +++ b/src/tribler/gui/sentry_mixin.py @@ -1,4 +1,4 @@ -from tribler_gui import gui_sentry_reporter +from tribler.gui import gui_sentry_reporter class AddBreadcrumbOnShowMixin: diff --git a/src/tribler-gui/tribler_gui/single_application.py b/src/tribler/gui/single_application.py similarity index 98% rename from src/tribler-gui/tribler_gui/single_application.py rename to src/tribler/gui/single_application.py index 4d9863dba41..6e29dd91349 100644 --- a/src/tribler-gui/tribler_gui/single_application.py +++ b/src/tribler/gui/single_application.py @@ -7,7 +7,7 @@ from PyQt5.QtNetwork import QLocalServer, QLocalSocket from PyQt5.QtWidgets import QApplication -from tribler_gui.utilities import connect, disconnect +from tribler.gui.utilities import connect, disconnect class QtSingleApplication(QApplication): diff --git a/src/tribler-gui/tribler_gui/start_gui.py b/src/tribler/gui/start_gui.py similarity index 87% rename from src/tribler-gui/tribler_gui/start_gui.py rename to src/tribler/gui/start_gui.py index b71756ee4dc..4f6547d3a22 100644 --- a/src/tribler-gui/tribler_gui/start_gui.py +++ b/src/tribler/gui/start_gui.py @@ -4,22 +4,22 @@ from PyQt5.QtCore import QSettings -from tribler_core.check_os import ( +from tribler.core.check_os import ( check_and_enable_code_tracing, check_environment, check_free_space, enable_fault_handler, error_and_exit, ) -from tribler_core.exceptions import TriblerException -from tribler_core.logger.logger import load_logger_config -from tribler_core.sentry_reporter.sentry_reporter import SentryStrategy -from tribler_core.utilities.rest_utils import path_to_uri - -from tribler_gui import gui_sentry_reporter -from tribler_gui.tribler_app import TriblerApplication -from tribler_gui.tribler_window import TriblerWindow -from tribler_gui.utilities import get_translator +from tribler.core.exceptions import TriblerException +from tribler.core.logger.logger import load_logger_config +from tribler.core.sentry_reporter.sentry_reporter import SentryStrategy +from tribler.core.utilities.rest_utils import path_to_uri + +from tribler.gui import gui_sentry_reporter +from tribler.gui.tribler_app import TriblerApplication +from tribler.gui.tribler_window import TriblerWindow +from tribler.gui.utilities import get_translator logger = logging.getLogger(__name__) diff --git a/src/tribler-gui/tribler_gui/widgets/graphs/__init__.py b/src/tribler/gui/tests/__init__.py similarity index 100% rename from src/tribler-gui/tribler_gui/widgets/graphs/__init__.py rename to src/tribler/gui/tests/__init__.py diff --git a/src/tribler-gui/tribler_gui/tests/conftest.py b/src/tribler/gui/tests/conftest.py similarity index 100% rename from src/tribler-gui/tribler_gui/tests/conftest.py rename to src/tribler/gui/tests/conftest.py diff --git a/src/tribler-gui/tribler_gui/tests/gui_test_data.py b/src/tribler/gui/tests/gui_test_data.py similarity index 100% rename from src/tribler-gui/tribler_gui/tests/gui_test_data.py rename to src/tribler/gui/tests/gui_test_data.py diff --git a/src/tribler-gui/tribler_gui/tests/test_core_manager.py b/src/tribler/gui/tests/test_core_manager.py similarity index 85% rename from src/tribler-gui/tribler_gui/tests/test_core_manager.py rename to src/tribler/gui/tests/test_core_manager.py index 6d1e9e112c6..be00c8a95de 100644 --- a/src/tribler-gui/tribler_gui/tests/test_core_manager.py +++ b/src/tribler/gui/tests/test_core_manager.py @@ -2,7 +2,7 @@ import pytest -from tribler_gui.core_manager import CoreCrashedError, CoreManager +from tribler.gui.core_manager import CoreCrashedError, CoreManager pytestmark = pytest.mark.asyncio @@ -10,7 +10,7 @@ # fmt: off @patch.object(CoreManager, 'quit_application') -@patch('tribler_gui.core_manager.EventRequestManager', new=MagicMock()) +@patch('tribler.gui.core_manager.EventRequestManager', new=MagicMock()) async def test_on_core_finished_call_on_finished(mocked_quit_application: MagicMock): # test that in case of `shutting_down` and `should_quit_app_on_core_finished` flags have been set to True # then `on_finished` function will be called and Exception will not be raised @@ -22,7 +22,7 @@ async def test_on_core_finished_call_on_finished(mocked_quit_application: MagicM mocked_quit_application.assert_called_once() -@patch('tribler_gui.core_manager.EventRequestManager', new=MagicMock()) +@patch('tribler.gui.core_manager.EventRequestManager', new=MagicMock()) async def test_on_core_finished_raises_error(): # test that in case of flag `shutting_down` has been set to True and # exit_code is not equal to 0, then CoreRuntimeError should be raised @@ -32,8 +32,8 @@ async def test_on_core_finished_raises_error(): core_manager.on_core_finished(exit_code=1, exit_status='exit status') -@patch('tribler_gui.core_manager.print') -@patch('tribler_gui.core_manager.EventRequestManager', new=MagicMock()) +@patch('tribler.gui.core_manager.print') +@patch('tribler.gui.core_manager.EventRequestManager', new=MagicMock()) async def test_on_core_stdout_read_ready(mocked_print: MagicMock): # test that method `on_core_stdout_read_ready` converts byte output to a string and prints it core_manager = CoreManager(MagicMock(), MagicMock(), MagicMock(), MagicMock()) @@ -42,8 +42,8 @@ async def test_on_core_stdout_read_ready(mocked_print: MagicMock): mocked_print.assert_called_with('binary string') -@patch('tribler_gui.core_manager.print') -@patch('tribler_gui.core_manager.EventRequestManager', new=MagicMock()) +@patch('tribler.gui.core_manager.print') +@patch('tribler.gui.core_manager.EventRequestManager', new=MagicMock()) @patch('sys.stderr') async def test_on_core_stderr_read_ready(mocked_stderr, mocked_print: MagicMock): # test that method `on_core_stdout_read_ready` converts byte output to a string and prints it @@ -53,7 +53,7 @@ async def test_on_core_stderr_read_ready(mocked_stderr, mocked_print: MagicMock) mocked_print.assert_called_with('binary string', file=mocked_stderr) -@patch('tribler_gui.core_manager.EventRequestManager', new=MagicMock()) +@patch('tribler.gui.core_manager.EventRequestManager', new=MagicMock()) @patch('builtins.print', MagicMock(side_effect=OSError())) def test_on_core_stdout_stderr_read_ready_os_error(): # test that OSError on writing to stdout is suppressed when quitting the application diff --git a/src/tribler-gui/tribler_gui/tests/test_error_handler.py b/src/tribler/gui/tests/test_error_handler.py similarity index 85% rename from src/tribler-gui/tribler_gui/tests/test_error_handler.py rename to src/tribler/gui/tests/test_error_handler.py index a3d7509dd9b..1aa00fbccbd 100644 --- a/src/tribler-gui/tribler_gui/tests/test_error_handler.py +++ b/src/tribler/gui/tests/test_error_handler.py @@ -2,11 +2,11 @@ import pytest -from tribler_core.components.reporter.reported_error import ReportedError -from tribler_core.sentry_reporter.sentry_reporter import SentryReporter, SentryStrategy +from tribler.core.components.reporter.reported_error import ReportedError +from tribler.core.sentry_reporter.sentry_reporter import SentryReporter, SentryStrategy -from tribler_gui.error_handler import ErrorHandler -from tribler_gui.exceptions import CoreConnectTimeoutError, CoreCrashedError +from tribler.gui.error_handler import ErrorHandler +from tribler.gui.exceptions import CoreConnectTimeoutError, CoreCrashedError pytestmark = pytest.mark.asyncio @@ -24,7 +24,7 @@ def reported_error(): return ReportedError(type='Exception', text='text', event={}) -@patch('tribler_gui.error_handler.FeedbackDialog') +@patch('tribler.gui.error_handler.FeedbackDialog') async def test_gui_error_tribler_stopped(mocked_feedback_dialog: MagicMock, error_handler: ErrorHandler): # test that while tribler_stopped is True FeedbackDialog is not called error_handler._tribler_stopped = True @@ -32,7 +32,7 @@ async def test_gui_error_tribler_stopped(mocked_feedback_dialog: MagicMock, erro mocked_feedback_dialog.assert_not_called() -@patch('tribler_gui.error_handler.FeedbackDialog') +@patch('tribler.gui.error_handler.FeedbackDialog') @patch.object(SentryReporter, 'global_strategy', create=True, new=PropertyMock(return_value=SentryStrategy.SEND_SUPPRESSED)) async def test_gui_error_suppressed(mocked_feedback_dialog: MagicMock, error_handler: ErrorHandler): @@ -44,7 +44,7 @@ async def test_gui_error_suppressed(mocked_feedback_dialog: MagicMock, error_han logger_info_mock.assert_called_with('GUI error was suppressed and not sent to Sentry: AssertionError: error_text') -@patch('tribler_gui.error_handler.FeedbackDialog') +@patch('tribler.gui.error_handler.FeedbackDialog') async def test_gui_info_type_in_handled_exceptions(mocked_feedback_dialog: MagicMock, error_handler: ErrorHandler): # test that if exception type in _handled_exceptions then FeedbackDialog is not called error_handler._handled_exceptions = {AssertionError} @@ -53,7 +53,7 @@ async def test_gui_info_type_in_handled_exceptions(mocked_feedback_dialog: Magic assert len(error_handler._handled_exceptions) == 1 -@patch('tribler_gui.error_handler.FeedbackDialog') +@patch('tribler.gui.error_handler.FeedbackDialog') @patch.object(ErrorHandler, '_stop_tribler') async def test_gui_core_connect_timeout_error(mocked_stop_tribler, mocked_feedback_dialog: MagicMock, error_handler: ErrorHandler): @@ -62,7 +62,7 @@ async def test_gui_core_connect_timeout_error(mocked_stop_tribler, mocked_feedba mocked_stop_tribler.assert_called_once() -@patch('tribler_gui.error_handler.FeedbackDialog') +@patch('tribler.gui.error_handler.FeedbackDialog') @patch.object(ErrorHandler, '_stop_tribler') async def test_gui_core_connect_timeout_error(mocked_stop_tribler: MagicMock, mocked_feedback_dialog: MagicMock, error_handler: ErrorHandler): @@ -72,7 +72,7 @@ async def test_gui_core_connect_timeout_error(mocked_stop_tribler: MagicMock, mo mocked_stop_tribler.assert_called_once() -@patch('tribler_gui.error_handler.FeedbackDialog') +@patch('tribler.gui.error_handler.FeedbackDialog') @patch.object(ErrorHandler, '_stop_tribler') async def test_gui_is_not_core_exception(mocked_stop_tribler: MagicMock, mocked_feedback_dialog: MagicMock, error_handler: ErrorHandler): @@ -83,7 +83,7 @@ async def test_gui_is_not_core_exception(mocked_stop_tribler: MagicMock, mocked_ mocked_stop_tribler.assert_not_called() -@patch('tribler_gui.error_handler.FeedbackDialog') +@patch('tribler.gui.error_handler.FeedbackDialog') async def test_core_info_type_in_handled_exceptions(mocked_feedback_dialog: MagicMock, error_handler: ErrorHandler, reported_error: ReportedError): # test that if exception type in _handled_exceptions then FeedbackDialog is not called @@ -93,7 +93,7 @@ async def test_core_info_type_in_handled_exceptions(mocked_feedback_dialog: Magi assert len(error_handler._handled_exceptions) == 1 -@patch('tribler_gui.error_handler.FeedbackDialog') +@patch('tribler.gui.error_handler.FeedbackDialog') async def test_core_should_stop(mocked_feedback_dialog: MagicMock, error_handler: ErrorHandler, reported_error: ReportedError): # test that in case of "should_stop=True", Tribler should stop it's work @@ -103,7 +103,7 @@ async def test_core_should_stop(mocked_feedback_dialog: MagicMock, error_handler error_handler._stop_tribler.assert_called_once() -@patch('tribler_gui.error_handler.FeedbackDialog') +@patch('tribler.gui.error_handler.FeedbackDialog') async def test_core_error(mocked_feedback_dialog: MagicMock, error_handler: ErrorHandler, reported_error: ReportedError): # test that core_error creates FeedbackDialog diff --git a/src/tribler-gui/tribler_gui/tests/test_gui.py b/src/tribler/gui/tests/test_gui.py similarity index 96% rename from src/tribler-gui/tribler_gui/tests/test_gui.py rename to src/tribler/gui/tests/test_gui.py index 8696a7c10db..0bf34c9fb1b 100644 --- a/src/tribler-gui/tribler_gui/tests/test_gui.py +++ b/src/tribler/gui/tests/test_gui.py @@ -10,26 +10,26 @@ import pytest -from tribler_core.components.reporter.reported_error import ReportedError -from tribler_core.components.tag.tag_constants import MIN_TAG_LENGTH -from tribler_core.sentry_reporter.sentry_reporter import SentryReporter -from tribler_core.tests.tools.common import TESTS_DATA_DIR -from tribler_core.utilities.rest_utils import path_to_uri -from tribler_core.utilities.unicode import hexlify - -import tribler_gui -from tribler_gui.dialogs.feedbackdialog import FeedbackDialog -from tribler_gui.dialogs.new_channel_dialog import NewChannelDialog -from tribler_gui.tests.gui_test_data import negative_token_balance_history -from tribler_gui.tribler_app import TriblerApplication -from tribler_gui.tribler_window import TriblerWindow -from tribler_gui.utilities import connect -from tribler_gui.widgets.loading_list_item import LoadingListItem -from tribler_gui.widgets.tablecontentmodel import Column -from tribler_gui.widgets.tagbutton import TagButton -from tribler_gui.widgets.torrentfiletreewidget import CHECKBOX_COL - -RUN_TRIBLER_PY = Path(tribler_gui.__file__).parent.parent.parent / "run_tribler.py" +from tribler.core.components.reporter.reported_error import ReportedError +from tribler.core.components.tag.tag_constants import MIN_TAG_LENGTH +from tribler.core.sentry_reporter.sentry_reporter import SentryReporter +from tribler.core.tests.tools.common import TESTS_DATA_DIR +from tribler.core.utilities.rest_utils import path_to_uri +from tribler.core.utilities.unicode import hexlify + +import tribler.gui +from tribler.gui.dialogs.feedbackdialog import FeedbackDialog +from tribler.gui.dialogs.new_channel_dialog import NewChannelDialog +from tribler.gui.tests.gui_test_data import negative_token_balance_history +from tribler.gui.tribler_app import TriblerApplication +from tribler.gui.tribler_window import TriblerWindow +from tribler.gui.utilities import connect +from tribler.gui.widgets.loading_list_item import LoadingListItem +from tribler.gui.widgets.tablecontentmodel import Column +from tribler.gui.widgets.tagbutton import TagButton +from tribler.gui.widgets.torrentfiletreewidget import CHECKBOX_COL + +RUN_TRIBLER_PY = Path(tribler.__file__).parent.parent / "run_tribler.py" TORRENT_WITH_DIRS = TESTS_DATA_DIR / "multi_entries.torrent" @@ -130,7 +130,7 @@ def screenshot(widget, name=None): if name is not None: img_name = f"screenshot_{name}.jpg" - screenshots_dir = os.path.join(os.path.dirname(tribler_gui.__file__), 'screenshots') + screenshots_dir = os.path.join(os.path.dirname(tribler.gui.__file__), 'screenshots') if not os.path.exists(screenshots_dir): os.mkdir(screenshots_dir) diff --git a/src/tribler-gui/tribler_gui/tests/test_util.py b/src/tribler/gui/tests/test_util.py similarity index 98% rename from src/tribler-gui/tribler_gui/tests/test_util.py rename to src/tribler/gui/tests/test_util.py index 16c98d876cf..1dfa0d82b12 100644 --- a/src/tribler-gui/tribler_gui/tests/test_util.py +++ b/src/tribler/gui/tests/test_util.py @@ -3,7 +3,7 @@ import pytest -from tribler_gui.utilities import compose_magnetlink, create_api_key, dict_item_is_any_of, format_api_key, \ +from tribler.gui.utilities import compose_magnetlink, create_api_key, dict_item_is_any_of, format_api_key, \ quote_plus_unicode, set_api_key, unicode_quoter diff --git a/src/tribler-gui/tribler_gui/tribler_action_menu.py b/src/tribler/gui/tribler_action_menu.py similarity index 93% rename from src/tribler-gui/tribler_gui/tribler_action_menu.py rename to src/tribler/gui/tribler_action_menu.py index 2ac0df655ee..ba198acc8d5 100644 --- a/src/tribler-gui/tribler_gui/tribler_action_menu.py +++ b/src/tribler/gui/tribler_action_menu.py @@ -1,6 +1,6 @@ from PyQt5.QtWidgets import QMenu -from tribler_gui.defs import CONTEXT_MENU_WIDTH +from tribler.gui.defs import CONTEXT_MENU_WIDTH class TriblerActionMenu(QMenu): diff --git a/src/tribler-gui/tribler_gui/tribler_app.py b/src/tribler/gui/tribler_app.py similarity index 89% rename from src/tribler-gui/tribler_gui/tribler_app.py rename to src/tribler/gui/tribler_app.py index b2c0d472670..592e008a0ec 100644 --- a/src/tribler-gui/tribler_gui/tribler_app.py +++ b/src/tribler/gui/tribler_app.py @@ -4,12 +4,12 @@ from PyQt5.QtCore import QCoreApplication, QEvent, Qt -from tribler_core.utilities.rest_utils import path_to_uri -from tribler_core.utilities.unicode import ensure_unicode +from tribler.core.utilities.rest_utils import path_to_uri +from tribler.core.utilities.unicode import ensure_unicode -from tribler_gui.code_executor import CodeExecutor -from tribler_gui.single_application import QtSingleApplication -from tribler_gui.utilities import connect +from tribler.gui.code_executor import CodeExecutor +from tribler.gui.single_application import QtSingleApplication +from tribler.gui.utilities import connect # Set the QT application parameters before creating any instances of the application. QCoreApplication.setAttribute(Qt.AA_UseHighDpiPixmaps) diff --git a/src/tribler-gui/tribler_gui/tribler_request_manager.py b/src/tribler/gui/tribler_request_manager.py similarity index 98% rename from src/tribler-gui/tribler_gui/tribler_request_manager.py rename to src/tribler/gui/tribler_request_manager.py index a587147bdd9..be5f2385f65 100644 --- a/src/tribler-gui/tribler_gui/tribler_request_manager.py +++ b/src/tribler/gui/tribler_request_manager.py @@ -7,9 +7,9 @@ from PyQt5.QtCore import QBuffer, QIODevice, QObject, QUrl, pyqtSignal from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkRequest -from tribler_gui.defs import BUTTON_TYPE_NORMAL, DEFAULT_API_HOST, DEFAULT_API_PORT, DEFAULT_API_PROTOCOL -from tribler_gui.dialogs.confirmationdialog import ConfirmationDialog -from tribler_gui.utilities import connect +from tribler.gui.defs import BUTTON_TYPE_NORMAL, DEFAULT_API_HOST, DEFAULT_API_PORT, DEFAULT_API_PROTOCOL +from tribler.gui.dialogs.confirmationdialog import ConfirmationDialog +from tribler.gui.utilities import connect def tribler_urlencode(data): diff --git a/src/tribler-gui/tribler_gui/tribler_window.py b/src/tribler/gui/tribler_window.py similarity index 97% rename from src/tribler-gui/tribler_gui/tribler_window.py rename to src/tribler/gui/tribler_window.py index db344f22f40..ea83e45a1f4 100644 --- a/src/tribler-gui/tribler_gui/tribler_window.py +++ b/src/tribler/gui/tribler_window.py @@ -38,23 +38,23 @@ from psutil import LINUX -from tribler_core.upgrade.version_manager import VersionHistory -from tribler_core.utilities.network_utils import default_network_utils -from tribler_core.utilities.process_checker import ProcessChecker -from tribler_core.utilities.rest_utils import ( +from tribler.core.upgrade.version_manager import VersionHistory +from tribler.core.utilities.network_utils import default_network_utils +from tribler.core.utilities.process_checker import ProcessChecker +from tribler.core.utilities.rest_utils import ( FILE_SCHEME, MAGNET_SCHEME, scheme_from_uri, uri_is_valid_file, uri_to_path, ) -from tribler_core.utilities.unicode import hexlify -from tribler_core.utilities.utilities import parse_query -from tribler_core.version import version_id +from tribler.core.utilities.unicode import hexlify +from tribler.core.utilities.utilities import parse_query +from tribler.core.version import version_id -from tribler_gui.core_manager import CoreManager -from tribler_gui.debug_window import DebugWindow -from tribler_gui.defs import ( +from tribler.gui.core_manager import CoreManager +from tribler.gui.debug_window import DebugWindow +from tribler.gui.defs import ( BUTTON_TYPE_CONFIRM, BUTTON_TYPE_NORMAL, CATEGORY_SELECTOR_FOR_POPULAR_ITEMS, @@ -72,16 +72,16 @@ PAGE_TRUST_GRAPH_PAGE, SHUTDOWN_WAITING_PERIOD, ) -from tribler_gui.dialogs.addtopersonalchanneldialog import AddToChannelDialog -from tribler_gui.dialogs.confirmationdialog import ConfirmationDialog -from tribler_gui.dialogs.createtorrentdialog import CreateTorrentDialog -from tribler_gui.dialogs.new_channel_dialog import NewChannelDialog -from tribler_gui.dialogs.startdownloaddialog import StartDownloadDialog -from tribler_gui.error_handler import ErrorHandler -from tribler_gui.tribler_action_menu import TriblerActionMenu -from tribler_gui.tribler_request_manager import TriblerNetworkRequest, TriblerRequestManager, request_manager -from tribler_gui.upgrade_manager import UpgradeManager -from tribler_gui.utilities import ( +from tribler.gui.dialogs.addtopersonalchanneldialog import AddToChannelDialog +from tribler.gui.dialogs.confirmationdialog import ConfirmationDialog +from tribler.gui.dialogs.createtorrentdialog import CreateTorrentDialog +from tribler.gui.dialogs.new_channel_dialog import NewChannelDialog +from tribler.gui.dialogs.startdownloaddialog import StartDownloadDialog +from tribler.gui.error_handler import ErrorHandler +from tribler.gui.tribler_action_menu import TriblerActionMenu +from tribler.gui.tribler_request_manager import TriblerNetworkRequest, TriblerRequestManager, request_manager +from tribler.gui.upgrade_manager import UpgradeManager +from tribler.gui.utilities import ( connect, create_api_key, disconnect, @@ -94,10 +94,10 @@ set_api_key, tr, ) -from tribler_gui.widgets.channelsmenulistwidget import ChannelsMenuListWidget -from tribler_gui.widgets.instanttooltipstyle import InstantTooltipStyle -from tribler_gui.widgets.tablecontentmodel import DiscoveredChannelsModel, PopularTorrentsModel -from tribler_gui.widgets.triblertablecontrollers import PopularContentTableViewController +from tribler.gui.widgets.channelsmenulistwidget import ChannelsMenuListWidget +from tribler.gui.widgets.instanttooltipstyle import InstantTooltipStyle +from tribler.gui.widgets.tablecontentmodel import DiscoveredChannelsModel, PopularTorrentsModel +from tribler.gui.widgets.triblertablecontrollers import PopularContentTableViewController fc_loading_list_item, _ = uic.loadUiType(get_ui_file_path('loading_list_item.ui')) diff --git a/src/tribler-gui/tribler_gui/upgrade_manager.py b/src/tribler/gui/upgrade_manager.py similarity index 94% rename from src/tribler-gui/tribler_gui/upgrade_manager.py rename to src/tribler/gui/upgrade_manager.py index 8acc9a6ac43..a6e1bbadf2f 100644 --- a/src/tribler-gui/tribler_gui/upgrade_manager.py +++ b/src/tribler/gui/upgrade_manager.py @@ -4,9 +4,10 @@ from PyQt5.QtCore import QObject, QThread, pyqtSignal from PyQt5.QtWidgets import QMessageBox -from tribler_core.upgrade.version_manager import TriblerVersion, VersionHistory +from tribler.run_tribler_upgrader import upgrade_state_dir +from tribler.core.upgrade.version_manager import TriblerVersion, VersionHistory -from tribler_gui.utilities import connect, format_size, tr +from tribler.gui.utilities import connect, format_size, tr class StateDirUpgradeWorker(QObject): @@ -108,8 +109,6 @@ def start(self): self.upgrader_tick.emit(tr('Backing up state directory, please wait')) self._upgrade_worker = StateDirUpgradeWorker(self.version_history.root_state_dir) - # We import it here because it is safer to do it in the main thread - from run_tribler_upgrader import upgrade_state_dir # pylint: disable=C0415 self._upgrade_worker._upgrade_state_dir = upgrade_state_dir # pylint: disable=W0212 self._upgrade_thread = QThread() diff --git a/src/tribler-gui/tribler_gui/utilities.py b/src/tribler/gui/utilities.py similarity index 99% rename from src/tribler-gui/tribler_gui/utilities.py rename to src/tribler/gui/utilities.py index ff27f8581fb..884d68a6089 100644 --- a/src/tribler-gui/tribler_gui/utilities.py +++ b/src/tribler/gui/utilities.py @@ -16,8 +16,8 @@ from PyQt5.QtGui import QPixmap, QRegion from PyQt5.QtWidgets import QApplication -import tribler_gui -from tribler_gui.defs import HEALTH_DEAD, HEALTH_GOOD, HEALTH_MOOT, HEALTH_UNCHECKED +import tribler.gui +from tribler.gui.defs import HEALTH_DEAD, HEALTH_GOOD, HEALTH_MOOT, HEALTH_UNCHECKED logger = logging.getLogger(__name__) @@ -162,7 +162,7 @@ def get_base_path(): # PyInstaller creates a temp folder and stores path in _MEIPASS base_path = sys._MEIPASS except Exception: - base_path = os.path.dirname(tribler_gui.__file__) + base_path = os.path.dirname(tribler.gui.__file__) return base_path diff --git a/src/tribler-gui/tribler_gui/widgets/__init__.py b/src/tribler/gui/widgets/__init__.py similarity index 100% rename from src/tribler-gui/tribler_gui/widgets/__init__.py rename to src/tribler/gui/widgets/__init__.py diff --git a/src/tribler-gui/tribler_gui/widgets/channelcontentswidget.py b/src/tribler/gui/widgets/channelcontentswidget.py similarity index 97% rename from src/tribler-gui/tribler_gui/widgets/channelcontentswidget.py rename to src/tribler/gui/widgets/channelcontentswidget.py index 715404262ac..34bebc5824a 100644 --- a/src/tribler-gui/tribler_gui/widgets/channelcontentswidget.py +++ b/src/tribler/gui/widgets/channelcontentswidget.py @@ -7,23 +7,23 @@ from psutil import LINUX -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import DIRTY_STATUSES, NEW -from tribler_core.components.metadata_store.db.serialization import CHANNEL_TORRENT, COLLECTION_NODE -from tribler_core.utilities.simpledefs import CHANNEL_STATE +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import DIRTY_STATUSES, NEW +from tribler.core.components.metadata_store.db.serialization import CHANNEL_TORRENT, COLLECTION_NODE +from tribler.core.utilities.simpledefs import CHANNEL_STATE -from tribler_gui.defs import ( +from tribler.gui.defs import ( BUTTON_TYPE_CONFIRM, BUTTON_TYPE_NORMAL, CATEGORY_SELECTOR_FOR_SEARCH_ITEMS, ContentCategories, ) -from tribler_gui.dialogs.confirmationdialog import ConfirmationDialog -from tribler_gui.dialogs.new_channel_dialog import NewChannelDialog -from tribler_gui.sentry_mixin import AddBreadcrumbOnShowMixin -from tribler_gui.tribler_action_menu import TriblerActionMenu -from tribler_gui.tribler_request_manager import TriblerNetworkRequest -from tribler_gui.utilities import connect, disconnect, get_image_path, get_ui_file_path, tr -from tribler_gui.widgets.tablecontentmodel import ( +from tribler.gui.dialogs.confirmationdialog import ConfirmationDialog +from tribler.gui.dialogs.new_channel_dialog import NewChannelDialog +from tribler.gui.sentry_mixin import AddBreadcrumbOnShowMixin +from tribler.gui.tribler_action_menu import TriblerActionMenu +from tribler.gui.tribler_request_manager import TriblerNetworkRequest +from tribler.gui.utilities import connect, disconnect, get_image_path, get_ui_file_path, tr +from tribler.gui.widgets.tablecontentmodel import ( ChannelContentModel, ChannelPreviewModel, DiscoveredChannelsModel, @@ -31,7 +31,7 @@ SearchResultsModel, SimplifiedPersonalChannelsModel, ) -from tribler_gui.widgets.triblertablecontrollers import ContentTableViewController +from tribler.gui.widgets.triblertablecontrollers import ContentTableViewController CHANNEL_COMMIT_DELAY = 30000 # milliseconds widget_form, widget_class = uic.loadUiType(get_ui_file_path('torrents_list.ui')) diff --git a/src/tribler-gui/tribler_gui/widgets/channeldescriptionwidget.py b/src/tribler/gui/widgets/channeldescriptionwidget.py similarity index 97% rename from src/tribler-gui/tribler_gui/widgets/channeldescriptionwidget.py rename to src/tribler/gui/widgets/channeldescriptionwidget.py index 4462ff4881d..e0bac1a0a6e 100644 --- a/src/tribler-gui/tribler_gui/widgets/channeldescriptionwidget.py +++ b/src/tribler/gui/widgets/channeldescriptionwidget.py @@ -6,10 +6,10 @@ from PyQt5.QtNetwork import QNetworkRequest from PyQt5.QtWidgets import QFileDialog, QPushButton -from tribler_gui.dialogs.confirmationdialog import ConfirmationDialog -from tribler_gui.sentry_mixin import AddBreadcrumbOnShowMixin -from tribler_gui.tribler_request_manager import TriblerNetworkRequest -from tribler_gui.utilities import connect, get_image_path, get_ui_file_path, tr +from tribler.gui.dialogs.confirmationdialog import ConfirmationDialog +from tribler.gui.sentry_mixin import AddBreadcrumbOnShowMixin +from tribler.gui.tribler_request_manager import TriblerNetworkRequest +from tribler.gui.utilities import connect, get_image_path, get_ui_file_path, tr widget_form, widget_class = uic.loadUiType(get_ui_file_path('channel_description.ui')) diff --git a/src/tribler-gui/tribler_gui/widgets/channelsmenulistwidget.py b/src/tribler/gui/widgets/channelsmenulistwidget.py similarity index 95% rename from src/tribler-gui/tribler_gui/widgets/channelsmenulistwidget.py rename to src/tribler/gui/widgets/channelsmenulistwidget.py index 2c7c2bc1e02..910fee64050 100644 --- a/src/tribler-gui/tribler_gui/widgets/channelsmenulistwidget.py +++ b/src/tribler/gui/widgets/channelsmenulistwidget.py @@ -4,12 +4,12 @@ from PyQt5.QtGui import QBrush, QColor, QIcon, QPixmap from PyQt5.QtWidgets import QAbstractItemView, QAbstractScrollArea, QAction, QListWidget, QListWidgetItem -from tribler_core.components.metadata_store.db.serialization import CHANNEL_TORRENT -from tribler_core.utilities.simpledefs import CHANNEL_STATE +from tribler.core.components.metadata_store.db.serialization import CHANNEL_TORRENT +from tribler.core.utilities.simpledefs import CHANNEL_STATE -from tribler_gui.tribler_action_menu import TriblerActionMenu -from tribler_gui.tribler_request_manager import TriblerNetworkRequest -from tribler_gui.utilities import connect, get_image_path, tr +from tribler.gui.tribler_action_menu import TriblerActionMenu +from tribler.gui.tribler_request_manager import TriblerNetworkRequest +from tribler.gui.utilities import connect, get_image_path, tr def entry_to_tuple(entry): diff --git a/src/tribler-gui/tribler_gui/widgets/circlebutton.py b/src/tribler/gui/widgets/circlebutton.py similarity index 100% rename from src/tribler-gui/tribler_gui/widgets/circlebutton.py rename to src/tribler/gui/widgets/circlebutton.py diff --git a/src/tribler-gui/tribler_gui/widgets/clickable_line_edit.py b/src/tribler/gui/widgets/clickable_line_edit.py similarity index 100% rename from src/tribler-gui/tribler_gui/widgets/clickable_line_edit.py rename to src/tribler/gui/widgets/clickable_line_edit.py diff --git a/src/tribler-gui/tribler_gui/widgets/clickablewidgets.py b/src/tribler/gui/widgets/clickablewidgets.py similarity index 100% rename from src/tribler-gui/tribler_gui/widgets/clickablewidgets.py rename to src/tribler/gui/widgets/clickablewidgets.py diff --git a/src/tribler-gui/tribler_gui/widgets/createtorrentpage.py b/src/tribler/gui/widgets/createtorrentpage.py similarity index 93% rename from src/tribler-gui/tribler_gui/widgets/createtorrentpage.py rename to src/tribler/gui/widgets/createtorrentpage.py index 69a30fe809e..0312e15b8b2 100644 --- a/src/tribler-gui/tribler_gui/widgets/createtorrentpage.py +++ b/src/tribler/gui/widgets/createtorrentpage.py @@ -4,12 +4,12 @@ from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QAction, QFileDialog, QWidget -from tribler_gui.defs import BUTTON_TYPE_NORMAL, PAGE_EDIT_CHANNEL_TORRENTS -from tribler_gui.dialogs.confirmationdialog import ConfirmationDialog -from tribler_gui.sentry_mixin import AddBreadcrumbOnShowMixin -from tribler_gui.tribler_action_menu import TriblerActionMenu -from tribler_gui.tribler_request_manager import TriblerNetworkRequest -from tribler_gui.utilities import connect, get_image_path +from tribler.gui.defs import BUTTON_TYPE_NORMAL, PAGE_EDIT_CHANNEL_TORRENTS +from tribler.gui.dialogs.confirmationdialog import ConfirmationDialog +from tribler.gui.sentry_mixin import AddBreadcrumbOnShowMixin +from tribler.gui.tribler_action_menu import TriblerActionMenu +from tribler.gui.tribler_request_manager import TriblerNetworkRequest +from tribler.gui.utilities import connect, get_image_path class CreateTorrentPage(AddBreadcrumbOnShowMixin, QWidget): diff --git a/src/tribler-gui/tribler_gui/widgets/discoveringpage.py b/src/tribler/gui/widgets/discoveringpage.py similarity index 85% rename from src/tribler-gui/tribler_gui/widgets/discoveringpage.py rename to src/tribler/gui/widgets/discoveringpage.py index 4a968501330..dc92a607d09 100644 --- a/src/tribler-gui/tribler_gui/widgets/discoveringpage.py +++ b/src/tribler/gui/widgets/discoveringpage.py @@ -1,8 +1,8 @@ from PyQt5.QtWidgets import QWidget -from tribler_gui.sentry_mixin import AddBreadcrumbOnShowMixin -from tribler_gui.utilities import connect -from tribler_gui.widgets.loadingpage import LOADING_ANIMATION +from tribler.gui.sentry_mixin import AddBreadcrumbOnShowMixin +from tribler.gui.utilities import connect +from tribler.gui.widgets.loadingpage import LOADING_ANIMATION class DiscoveringPage(AddBreadcrumbOnShowMixin, QWidget): diff --git a/src/tribler-gui/tribler_gui/widgets/downloadprogressbar.py b/src/tribler/gui/widgets/downloadprogressbar.py similarity index 100% rename from src/tribler-gui/tribler_gui/widgets/downloadprogressbar.py rename to src/tribler/gui/widgets/downloadprogressbar.py diff --git a/src/tribler-gui/tribler_gui/widgets/downloadsdetailstabwidget.py b/src/tribler/gui/widgets/downloadsdetailstabwidget.py similarity index 97% rename from src/tribler-gui/tribler_gui/widgets/downloadsdetailstabwidget.py rename to src/tribler/gui/widgets/downloadsdetailstabwidget.py index 0d9010e9ca7..b92f15e35c3 100644 --- a/src/tribler-gui/tribler_gui/widgets/downloadsdetailstabwidget.py +++ b/src/tribler/gui/widgets/downloadsdetailstabwidget.py @@ -3,11 +3,11 @@ from PyQt5.QtCore import QTimer, Qt from PyQt5.QtWidgets import QTabWidget, QTreeWidgetItem -from tribler_core.utilities.simpledefs import dlstatus_strings +from tribler.core.utilities.simpledefs import dlstatus_strings -from tribler_gui.defs import DLSTATUS_STOPPED_ON_ERROR, DLSTATUS_STRINGS -from tribler_gui.tribler_request_manager import TriblerNetworkRequest -from tribler_gui.utilities import compose_magnetlink, connect, copy_to_clipboard, format_size, format_speed, tr +from tribler.gui.defs import DLSTATUS_STOPPED_ON_ERROR, DLSTATUS_STRINGS +from tribler.gui.tribler_request_manager import TriblerNetworkRequest +from tribler.gui.utilities import compose_magnetlink, connect, copy_to_clipboard, format_size, format_speed, tr INCLUDED_FILES_CHANGE_DELAY = 1000 # milliseconds diff --git a/src/tribler-gui/tribler_gui/widgets/downloadspage.py b/src/tribler/gui/widgets/downloadspage.py similarity index 98% rename from src/tribler-gui/tribler_gui/widgets/downloadspage.py rename to src/tribler/gui/widgets/downloadspage.py index 9313d980c51..41c62b78aaf 100644 --- a/src/tribler-gui/tribler_gui/widgets/downloadspage.py +++ b/src/tribler/gui/widgets/downloadspage.py @@ -6,7 +6,7 @@ from PyQt5.QtNetwork import QNetworkRequest from PyQt5.QtWidgets import QAbstractItemView, QAction, QFileDialog, QWidget -from tribler_gui.defs import ( +from tribler.gui.defs import ( BUTTON_TYPE_CONFIRM, BUTTON_TYPE_NORMAL, DLSTATUS_CIRCUITS, @@ -24,13 +24,13 @@ DOWNLOADS_FILTER_DOWNLOADING, DOWNLOADS_FILTER_INACTIVE, ) -from tribler_gui.dialogs.confirmationdialog import ConfirmationDialog -from tribler_gui.sentry_mixin import AddBreadcrumbOnShowMixin -from tribler_gui.tribler_action_menu import TriblerActionMenu -from tribler_gui.tribler_request_manager import TriblerFileDownloadRequest, TriblerNetworkRequest -from tribler_gui.utilities import compose_magnetlink, connect, format_speed, tr -from tribler_gui.widgets.downloadwidgetitem import DownloadWidgetItem, LoadingDownloadWidgetItem -from tribler_gui.widgets.loading_list_item import LoadingListItem +from tribler.gui.dialogs.confirmationdialog import ConfirmationDialog +from tribler.gui.sentry_mixin import AddBreadcrumbOnShowMixin +from tribler.gui.tribler_action_menu import TriblerActionMenu +from tribler.gui.tribler_request_manager import TriblerFileDownloadRequest, TriblerNetworkRequest +from tribler.gui.utilities import compose_magnetlink, connect, format_speed, tr +from tribler.gui.widgets.downloadwidgetitem import DownloadWidgetItem, LoadingDownloadWidgetItem +from tribler.gui.widgets.loading_list_item import LoadingListItem button_name2filter = { "downloads_all_button": DOWNLOADS_FILTER_ALL, diff --git a/src/tribler-gui/tribler_gui/widgets/downloadwidgetitem.py b/src/tribler/gui/widgets/downloadwidgetitem.py similarity index 96% rename from src/tribler-gui/tribler_gui/widgets/downloadwidgetitem.py rename to src/tribler/gui/widgets/downloadwidgetitem.py index 257c00be417..bd52a3018db 100644 --- a/src/tribler-gui/tribler_gui/widgets/downloadwidgetitem.py +++ b/src/tribler/gui/widgets/downloadwidgetitem.py @@ -4,10 +4,10 @@ from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QProgressBar, QTreeWidgetItem, QVBoxLayout, QWidget -from tribler_core.utilities.simpledefs import dlstatus_strings +from tribler.core.utilities.simpledefs import dlstatus_strings -from tribler_gui.defs import DLSTATUS_DOWNLOADING, DLSTATUS_METADATA, DLSTATUS_STRINGS -from tribler_gui.utilities import duration_to_string, format_size, format_speed +from tribler.gui.defs import DLSTATUS_DOWNLOADING, DLSTATUS_METADATA, DLSTATUS_STRINGS +from tribler.gui.utilities import duration_to_string, format_size, format_speed class LoadingDownloadWidgetItem(QTreeWidgetItem): diff --git a/src/tribler-gui/tribler_gui/widgets/ellipsebutton.py b/src/tribler/gui/widgets/ellipsebutton.py similarity index 100% rename from src/tribler-gui/tribler_gui/widgets/ellipsebutton.py rename to src/tribler/gui/widgets/ellipsebutton.py diff --git a/src/tribler/gui/widgets/graphs/__init__.py b/src/tribler/gui/widgets/graphs/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/tribler-gui/tribler_gui/widgets/graphs/dataplot.py b/src/tribler/gui/widgets/graphs/dataplot.py similarity index 81% rename from src/tribler-gui/tribler_gui/widgets/graphs/dataplot.py rename to src/tribler/gui/widgets/graphs/dataplot.py index aac3ddc6e7d..0bdbdf60663 100644 --- a/src/tribler-gui/tribler_gui/widgets/graphs/dataplot.py +++ b/src/tribler/gui/widgets/graphs/dataplot.py @@ -1,8 +1,8 @@ import pyqtgraph as pg from pyqtgraph import DateAxisItem -from tribler_gui.utilities import format_size -from tribler_gui.widgets.graphs.timeseriesplot import TimeSeriesPlot +from tribler.gui.utilities import format_size +from tribler.gui.widgets.graphs.timeseriesplot import TimeSeriesPlot class DataAxisItem(pg.AxisItem): diff --git a/src/tribler-gui/tribler_gui/widgets/graphs/timeseriesplot.py b/src/tribler/gui/widgets/graphs/timeseriesplot.py similarity index 97% rename from src/tribler-gui/tribler_gui/widgets/graphs/timeseriesplot.py rename to src/tribler/gui/widgets/graphs/timeseriesplot.py index 5c479b0d77c..2146a04eb16 100644 --- a/src/tribler-gui/tribler_gui/widgets/graphs/timeseriesplot.py +++ b/src/tribler/gui/widgets/graphs/timeseriesplot.py @@ -4,7 +4,7 @@ from pyqtgraph import DateAxisItem from pyqtgraph.graphicsItems.DateAxisItem import YEAR_SPACING -from tribler_gui.defs import BITTORRENT_BIRTHDAY +from tribler.gui.defs import BITTORRENT_BIRTHDAY class TimeSeriesPlot(pg.PlotWidget): diff --git a/src/tribler-gui/tribler_gui/widgets/instanttooltipbutton.py b/src/tribler/gui/widgets/instanttooltipbutton.py similarity index 100% rename from src/tribler-gui/tribler_gui/widgets/instanttooltipbutton.py rename to src/tribler/gui/widgets/instanttooltipbutton.py diff --git a/src/tribler-gui/tribler_gui/widgets/instanttooltipstyle.py b/src/tribler/gui/widgets/instanttooltipstyle.py similarity index 89% rename from src/tribler-gui/tribler_gui/widgets/instanttooltipstyle.py rename to src/tribler/gui/widgets/instanttooltipstyle.py index 492e75dfe28..d8d825aa0c0 100644 --- a/src/tribler-gui/tribler_gui/widgets/instanttooltipstyle.py +++ b/src/tribler/gui/widgets/instanttooltipstyle.py @@ -1,6 +1,6 @@ from PyQt5.QtWidgets import QProxyStyle, QStyle -from tribler_gui.widgets.instanttooltipbutton import InstantTooltipButton +from tribler.gui.widgets.instanttooltipbutton import InstantTooltipButton class InstantTooltipStyle(QProxyStyle): diff --git a/src/tribler-gui/tribler_gui/widgets/ipv8health.py b/src/tribler/gui/widgets/ipv8health.py similarity index 98% rename from src/tribler-gui/tribler_gui/widgets/ipv8health.py rename to src/tribler/gui/widgets/ipv8health.py index 691ff8ebac1..ebe99207269 100644 --- a/src/tribler-gui/tribler_gui/widgets/ipv8health.py +++ b/src/tribler/gui/widgets/ipv8health.py @@ -6,8 +6,8 @@ from PyQt5.QtGui import QPainter from PyQt5.QtWidgets import QWidget -from tribler_gui.sentry_mixin import AddBreadcrumbOnShowMixin -from tribler_gui.utilities import connect +from tribler.gui.sentry_mixin import AddBreadcrumbOnShowMixin +from tribler.gui.utilities import connect class MonitorWidget(AddBreadcrumbOnShowMixin, QWidget): diff --git a/src/tribler-gui/tribler_gui/widgets/lazytableview.py b/src/tribler/gui/widgets/lazytableview.py similarity index 95% rename from src/tribler-gui/tribler_gui/widgets/lazytableview.py rename to src/tribler/gui/widgets/lazytableview.py index c606d5cedb6..7e7d055f128 100644 --- a/src/tribler-gui/tribler_gui/widgets/lazytableview.py +++ b/src/tribler/gui/widgets/lazytableview.py @@ -5,15 +5,15 @@ from PyQt5.QtGui import QGuiApplication, QMouseEvent, QMovie from PyQt5.QtWidgets import QAbstractItemView, QApplication, QHeaderView, QLabel, QTableView -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import LEGACY_ENTRY -from tribler_core.components.metadata_store.db.serialization import CHANNEL_TORRENT, COLLECTION_NODE, REGULAR_TORRENT - -from tribler_gui.defs import COMMIT_STATUS_COMMITTED -from tribler_gui.dialogs.addtagsdialog import AddTagsDialog -from tribler_gui.tribler_request_manager import TriblerNetworkRequest -from tribler_gui.utilities import connect, data_item2uri, get_image_path, index2uri -from tribler_gui.widgets.tablecontentdelegate import TriblerContentDelegate -from tribler_gui.widgets.tablecontentmodel import Column, EXPANDING +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import LEGACY_ENTRY +from tribler.core.components.metadata_store.db.serialization import CHANNEL_TORRENT, COLLECTION_NODE, REGULAR_TORRENT + +from tribler.gui.defs import COMMIT_STATUS_COMMITTED +from tribler.gui.dialogs.addtagsdialog import AddTagsDialog +from tribler.gui.tribler_request_manager import TriblerNetworkRequest +from tribler.gui.utilities import connect, data_item2uri, get_image_path, index2uri +from tribler.gui.widgets.tablecontentdelegate import TriblerContentDelegate +from tribler.gui.widgets.tablecontentmodel import Column, EXPANDING class FloatingAnimationWidget(QLabel): diff --git a/src/tribler-gui/tribler_gui/widgets/loading_list_item.py b/src/tribler/gui/widgets/loading_list_item.py similarity index 87% rename from src/tribler-gui/tribler_gui/widgets/loading_list_item.py rename to src/tribler/gui/widgets/loading_list_item.py index 76392b84c5f..1130d1d0a9c 100644 --- a/src/tribler-gui/tribler_gui/widgets/loading_list_item.py +++ b/src/tribler/gui/widgets/loading_list_item.py @@ -1,6 +1,6 @@ from PyQt5.QtWidgets import QWidget -from tribler_gui.tribler_window import fc_loading_list_item +from tribler.gui.tribler_window import fc_loading_list_item class LoadingListItem(QWidget, fc_loading_list_item): diff --git a/src/tribler-gui/tribler_gui/widgets/loadingpage.py b/src/tribler/gui/widgets/loadingpage.py similarity index 93% rename from src/tribler-gui/tribler_gui/widgets/loadingpage.py rename to src/tribler/gui/widgets/loadingpage.py index 09376b91bd8..5d6b82c6265 100644 --- a/src/tribler-gui/tribler_gui/widgets/loadingpage.py +++ b/src/tribler/gui/widgets/loadingpage.py @@ -1,8 +1,8 @@ from PyQt5.QtSvg import QGraphicsSvgItem, QSvgRenderer from PyQt5.QtWidgets import QGraphicsScene, QWidget -from tribler_gui.sentry_mixin import AddBreadcrumbOnShowMixin -from tribler_gui.utilities import connect, get_image_path +from tribler.gui.sentry_mixin import AddBreadcrumbOnShowMixin +from tribler.gui.utilities import connect, get_image_path def load_gears_animation(): diff --git a/src/tribler-gui/tribler_gui/widgets/qtbug.py b/src/tribler/gui/widgets/qtbug.py similarity index 89% rename from src/tribler-gui/tribler_gui/widgets/qtbug.py rename to src/tribler/gui/widgets/qtbug.py index 34e9a0bd2f9..1972911d3a9 100644 --- a/src/tribler-gui/tribler_gui/widgets/qtbug.py +++ b/src/tribler/gui/widgets/qtbug.py @@ -1,7 +1,7 @@ from PyQt5 import uic from PyQt5.QtWidgets import QWidget -from tribler_gui.utilities import get_ui_file_path +from tribler.gui.utilities import get_ui_file_path # This file is a result of a nasty QT bug that PREVENTS US from loading some custom # widgets WITHOUT custom subwidgets. diff --git a/src/tribler-gui/tribler_gui/widgets/searchresultswidget.py b/src/tribler/gui/widgets/searchresultswidget.py similarity index 93% rename from src/tribler-gui/tribler_gui/widgets/searchresultswidget.py rename to src/tribler/gui/widgets/searchresultswidget.py index 0680546c15a..f94535fb115 100644 --- a/src/tribler-gui/tribler_gui/widgets/searchresultswidget.py +++ b/src/tribler/gui/widgets/searchresultswidget.py @@ -5,13 +5,13 @@ from PyQt5 import uic -from tribler_core.components.metadata_store.db.serialization import CHANNEL_TORRENT, COLLECTION_NODE, REGULAR_TORRENT -from tribler_core.utilities.utilities import Query, to_fts_query +from tribler.core.components.metadata_store.db.serialization import CHANNEL_TORRENT, COLLECTION_NODE, REGULAR_TORRENT +from tribler.core.utilities.utilities import Query, to_fts_query -from tribler_gui.sentry_mixin import AddBreadcrumbOnShowMixin -from tribler_gui.tribler_request_manager import TriblerNetworkRequest -from tribler_gui.utilities import connect, get_ui_file_path, tr -from tribler_gui.widgets.tablecontentmodel import SearchResultsModel +from tribler.gui.sentry_mixin import AddBreadcrumbOnShowMixin +from tribler.gui.tribler_request_manager import TriblerNetworkRequest +from tribler.gui.utilities import connect, get_ui_file_path, tr +from tribler.gui.widgets.tablecontentmodel import SearchResultsModel widget_form, widget_class = uic.loadUiType(get_ui_file_path('search_results.ui')) diff --git a/src/tribler-gui/tribler_gui/widgets/settingspage.py b/src/tribler/gui/widgets/settingspage.py similarity index 98% rename from src/tribler-gui/tribler_gui/widgets/settingspage.py rename to src/tribler/gui/widgets/settingspage.py index 551056816c5..a1d756a2dbe 100644 --- a/src/tribler-gui/tribler_gui/widgets/settingspage.py +++ b/src/tribler/gui/widgets/settingspage.py @@ -3,11 +3,11 @@ from PyQt5.QtCore import pyqtSignal from PyQt5.QtWidgets import QCheckBox, QFileDialog, QMessageBox, QSizePolicy, QWidget -from tribler_core.upgrade.version_manager import remove_state_dirs -from tribler_core.utilities.osutils import get_root_state_directory -from tribler_core.utilities.simpledefs import MAX_LIBTORRENT_RATE_LIMIT +from tribler.core.upgrade.version_manager import remove_state_dirs +from tribler.core.utilities.osutils import get_root_state_directory +from tribler.core.utilities.simpledefs import MAX_LIBTORRENT_RATE_LIMIT -from tribler_gui.defs import ( +from tribler.gui.defs import ( DARWIN, DEFAULT_API_PORT, PAGE_SETTINGS_ANONYMITY, @@ -18,10 +18,10 @@ PAGE_SETTINGS_GENERAL, PAGE_SETTINGS_SEEDING, ) -from tribler_gui.dialogs.confirmationdialog import ConfirmationDialog -from tribler_gui.sentry_mixin import AddBreadcrumbOnShowMixin -from tribler_gui.tribler_request_manager import TriblerNetworkRequest -from tribler_gui.utilities import ( +from tribler.gui.dialogs.confirmationdialog import ConfirmationDialog +from tribler.gui.sentry_mixin import AddBreadcrumbOnShowMixin +from tribler.gui.tribler_request_manager import TriblerNetworkRequest +from tribler.gui.utilities import ( AVAILABLE_TRANSLATIONS, connect, format_size, diff --git a/src/tribler-gui/tribler_gui/widgets/subscriptionswidget.py b/src/tribler/gui/widgets/subscriptionswidget.py similarity index 95% rename from src/tribler-gui/tribler_gui/widgets/subscriptionswidget.py rename to src/tribler/gui/widgets/subscriptionswidget.py index b68bb3c67d0..980d312cde4 100644 --- a/src/tribler-gui/tribler_gui/widgets/subscriptionswidget.py +++ b/src/tribler/gui/widgets/subscriptionswidget.py @@ -2,9 +2,9 @@ from PyQt5.QtGui import QFont from PyQt5.QtWidgets import QLabel, QWidget -from tribler_gui.sentry_mixin import AddBreadcrumbOnShowMixin -from tribler_gui.utilities import connect, format_votes_rich_text, get_votes_rating_description, tr -from tribler_gui.widgets.tablecontentdelegate import DARWIN, WINDOWS +from tribler.gui.sentry_mixin import AddBreadcrumbOnShowMixin +from tribler.gui.utilities import connect, format_votes_rich_text, get_votes_rating_description, tr +from tribler.gui.widgets.tablecontentdelegate import DARWIN, WINDOWS class SubscriptionsWidget(AddBreadcrumbOnShowMixin, QWidget): diff --git a/src/tribler-gui/tribler_gui/widgets/tabbuttonpanel.py b/src/tribler/gui/widgets/tabbuttonpanel.py similarity index 93% rename from src/tribler-gui/tribler_gui/widgets/tabbuttonpanel.py rename to src/tribler/gui/widgets/tabbuttonpanel.py index 0394bbf00f7..44d48e06484 100644 --- a/src/tribler-gui/tribler_gui/widgets/tabbuttonpanel.py +++ b/src/tribler/gui/widgets/tabbuttonpanel.py @@ -1,8 +1,8 @@ from PyQt5.QtCore import pyqtSignal from PyQt5.QtWidgets import QWidget -from tribler_gui import gui_sentry_reporter -from tribler_gui.utilities import connect +from tribler.gui import gui_sentry_reporter +from tribler.gui.utilities import connect class TabButtonPanel(QWidget): diff --git a/src/tribler-gui/tribler_gui/widgets/tablecontentdelegate.py b/src/tribler/gui/widgets/tablecontentdelegate.py similarity index 98% rename from src/tribler-gui/tribler_gui/widgets/tablecontentdelegate.py rename to src/tribler/gui/widgets/tablecontentdelegate.py index f2ef8c39cea..81e39580172 100644 --- a/src/tribler-gui/tribler_gui/widgets/tablecontentdelegate.py +++ b/src/tribler/gui/widgets/tablecontentdelegate.py @@ -7,11 +7,11 @@ from psutil import LINUX -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import LEGACY_ENTRY -from tribler_core.components.metadata_store.db.serialization import CHANNEL_TORRENT, COLLECTION_NODE, REGULAR_TORRENT -from tribler_core.utilities.simpledefs import CHANNEL_STATE +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import LEGACY_ENTRY +from tribler.core.components.metadata_store.db.serialization import CHANNEL_TORRENT, COLLECTION_NODE, REGULAR_TORRENT +from tribler.core.utilities.simpledefs import CHANNEL_STATE -from tribler_gui.defs import ( +from tribler.gui.defs import ( COMMIT_STATUS_COMMITTED, COMMIT_STATUS_NEW, COMMIT_STATUS_TODELETE, @@ -33,9 +33,9 @@ TAG_TOP_MARGIN, WINDOWS, ) -from tribler_gui.utilities import format_votes, get_gui_setting, get_health, get_image_path, tr -from tribler_gui.widgets.tablecontentmodel import Column -from tribler_gui.widgets.tableiconbuttons import DownloadIconButton +from tribler.gui.utilities import format_votes, get_gui_setting, get_health, get_image_path, tr +from tribler.gui.widgets.tablecontentmodel import Column +from tribler.gui.widgets.tableiconbuttons import DownloadIconButton PROGRESS_BAR_BACKGROUND = QColor("#444444") PROGRESS_BAR_FOREGROUND = QColor("#BBBBBB") diff --git a/src/tribler-gui/tribler_gui/widgets/tablecontentmodel.py b/src/tribler/gui/widgets/tablecontentmodel.py similarity index 98% rename from src/tribler-gui/tribler_gui/widgets/tablecontentmodel.py rename to src/tribler/gui/widgets/tablecontentmodel.py index f927d50ffa6..e145f64629e 100644 --- a/src/tribler-gui/tribler_gui/widgets/tablecontentmodel.py +++ b/src/tribler/gui/widgets/tablecontentmodel.py @@ -7,14 +7,14 @@ from PyQt5.QtCore import QAbstractTableModel, QModelIndex, QRectF, QSize, Qt, pyqtSignal -from tribler_core.components.metadata_store.db.orm_bindings.channel_node import NEW -from tribler_core.components.metadata_store.db.serialization import CHANNEL_TORRENT, COLLECTION_NODE, REGULAR_TORRENT -from tribler_core.utilities.simpledefs import CHANNELS_VIEW_UUID, CHANNEL_STATE -from tribler_core.utilities.utilities import to_fts_query - -from tribler_gui.defs import BITTORRENT_BIRTHDAY, COMMIT_STATUS_TODELETE, HEALTH_CHECKING -from tribler_gui.tribler_request_manager import TriblerNetworkRequest -from tribler_gui.utilities import connect, format_size, format_votes, get_votes_rating_description, pretty_date, tr +from tribler.core.components.metadata_store.db.orm_bindings.channel_node import NEW +from tribler.core.components.metadata_store.db.serialization import CHANNEL_TORRENT, COLLECTION_NODE, REGULAR_TORRENT +from tribler.core.utilities.simpledefs import CHANNELS_VIEW_UUID, CHANNEL_STATE +from tribler.core.utilities.utilities import to_fts_query + +from tribler.gui.defs import BITTORRENT_BIRTHDAY, COMMIT_STATUS_TODELETE, HEALTH_CHECKING +from tribler.gui.tribler_request_manager import TriblerNetworkRequest +from tribler.gui.utilities import connect, format_size, format_votes, get_votes_rating_description, pretty_date, tr EXPANDING = 0 diff --git a/src/tribler-gui/tribler_gui/widgets/tableiconbuttons.py b/src/tribler/gui/widgets/tableiconbuttons.py similarity index 97% rename from src/tribler-gui/tribler_gui/widgets/tableiconbuttons.py rename to src/tribler/gui/widgets/tableiconbuttons.py index a126e7af2c5..62cd68ebb13 100644 --- a/src/tribler-gui/tribler_gui/widgets/tableiconbuttons.py +++ b/src/tribler/gui/widgets/tableiconbuttons.py @@ -1,7 +1,7 @@ from PyQt5.QtCore import QEvent, QModelIndex, QObject, QRect, QSize, pyqtSignal from PyQt5.QtGui import QIcon -from tribler_gui.utilities import get_image_path +from tribler.gui.utilities import get_image_path class IconButton(QObject): diff --git a/src/tribler-gui/tribler_gui/widgets/tagbutton.py b/src/tribler/gui/widgets/tagbutton.py similarity index 95% rename from src/tribler-gui/tribler_gui/widgets/tagbutton.py rename to src/tribler/gui/widgets/tagbutton.py index dfed14f8961..7b000bf9a85 100644 --- a/src/tribler-gui/tribler_gui/widgets/tagbutton.py +++ b/src/tribler/gui/widgets/tagbutton.py @@ -2,7 +2,7 @@ from PyQt5.QtGui import QCursor from PyQt5.QtWidgets import QPushButton -from tribler_gui.defs import SUGGESTED_TAG_TEXT_COLOR, TAG_HEIGHT, SUGGESTED_TAG_BACKGROUND_COLOR, \ +from tribler.gui.defs import SUGGESTED_TAG_TEXT_COLOR, TAG_HEIGHT, SUGGESTED_TAG_BACKGROUND_COLOR, \ SUGGESTED_TAG_BORDER_COLOR, \ TAG_TEXT_HORIZONTAL_PADDING diff --git a/src/tribler-gui/tribler_gui/widgets/tagslineedit.py b/src/tribler/gui/widgets/tagslineedit.py similarity index 99% rename from src/tribler-gui/tribler_gui/widgets/tagslineedit.py rename to src/tribler/gui/widgets/tagslineedit.py index 79d3dc889e8..e9a4e6bba06 100644 --- a/src/tribler-gui/tribler_gui/widgets/tagslineedit.py +++ b/src/tribler/gui/widgets/tagslineedit.py @@ -15,7 +15,7 @@ ) from PyQt5.QtWidgets import QLineEdit, QStyle, QStyleOptionFrame -from tribler_gui.defs import ( +from tribler.gui.defs import ( EDIT_TAG_BACKGROUND_COLOR, EDIT_TAG_BORDER_COLOR, EDIT_TAG_TEXT_COLOR, diff --git a/src/tribler-gui/tribler_gui/widgets/timeoutprogressbar.py b/src/tribler/gui/widgets/timeoutprogressbar.py similarity index 95% rename from src/tribler-gui/tribler_gui/widgets/timeoutprogressbar.py rename to src/tribler/gui/widgets/timeoutprogressbar.py index 9a2a3acbfc8..2d50a3d1b04 100644 --- a/src/tribler-gui/tribler_gui/widgets/timeoutprogressbar.py +++ b/src/tribler/gui/widgets/timeoutprogressbar.py @@ -1,7 +1,7 @@ from PyQt5.QtCore import QTimer, pyqtSignal from PyQt5.QtWidgets import QProgressBar -from tribler_gui.utilities import connect +from tribler.gui.utilities import connect class TimeoutProgressBar(QProgressBar): diff --git a/src/tribler-gui/tribler_gui/widgets/togglebutton.py b/src/tribler/gui/widgets/togglebutton.py similarity index 98% rename from src/tribler-gui/tribler_gui/widgets/togglebutton.py rename to src/tribler/gui/widgets/togglebutton.py index ccb44485ebd..5f0e893e359 100644 --- a/src/tribler-gui/tribler_gui/widgets/togglebutton.py +++ b/src/tribler/gui/widgets/togglebutton.py @@ -4,7 +4,7 @@ # Toggle button in pure QT. Copy-pasted from StackOverflow answer https://stackoverflow.com/a/51825815/5553928 # Courtesy of Stefan Scherfke. -from tribler_gui.widgets.tablecontentdelegate import TRIBLER_PALETTE +from tribler.gui.widgets.tablecontentdelegate import TRIBLER_PALETTE class ToggleButton(QAbstractButton): diff --git a/src/tribler-gui/tribler_gui/widgets/torrentfiletreewidget.py b/src/tribler/gui/widgets/torrentfiletreewidget.py similarity index 98% rename from src/tribler-gui/tribler_gui/widgets/torrentfiletreewidget.py rename to src/tribler/gui/widgets/torrentfiletreewidget.py index c42de617db2..7f00f730c4f 100644 --- a/src/tribler-gui/tribler_gui/widgets/torrentfiletreewidget.py +++ b/src/tribler/gui/widgets/torrentfiletreewidget.py @@ -1,8 +1,8 @@ from PyQt5.QtCore import Qt, pyqtSignal from PyQt5.QtWidgets import QHeaderView, QTreeWidget, QTreeWidgetItem -from tribler_gui.utilities import connect, format_size, get_image_path -from tribler_gui.widgets.downloadwidgetitem import create_progress_bar_widget +from tribler.gui.utilities import connect, format_size, get_image_path +from tribler.gui.widgets.downloadwidgetitem import create_progress_bar_widget CHECKBOX_COL = 1 FILENAME_COL = 0 diff --git a/src/tribler-gui/tribler_gui/widgets/triblertablecontrollers.py b/src/tribler/gui/widgets/triblertablecontrollers.py similarity index 97% rename from src/tribler-gui/tribler_gui/widgets/triblertablecontrollers.py rename to src/tribler/gui/widgets/triblertablecontrollers.py index f8beca77b3f..99634fd9a62 100644 --- a/src/tribler-gui/tribler_gui/widgets/triblertablecontrollers.py +++ b/src/tribler/gui/widgets/triblertablecontrollers.py @@ -10,14 +10,14 @@ from PyQt5.QtNetwork import QNetworkRequest from PyQt5.QtWidgets import QAction -from tribler_core.components.metadata_store.db.serialization import CHANNEL_TORRENT, COLLECTION_NODE, REGULAR_TORRENT -from tribler_core.utilities.simpledefs import CHANNEL_STATE - -from tribler_gui.defs import HEALTH_CHECKING, HEALTH_UNCHECKED -from tribler_gui.tribler_action_menu import TriblerActionMenu -from tribler_gui.tribler_request_manager import TriblerNetworkRequest -from tribler_gui.utilities import connect, dict_item_is_any_of, get_health, tr -from tribler_gui.widgets.tablecontentmodel import Column +from tribler.core.components.metadata_store.db.serialization import CHANNEL_TORRENT, COLLECTION_NODE, REGULAR_TORRENT +from tribler.core.utilities.simpledefs import CHANNEL_STATE + +from tribler.gui.defs import HEALTH_CHECKING, HEALTH_UNCHECKED +from tribler.gui.tribler_action_menu import TriblerActionMenu +from tribler.gui.tribler_request_manager import TriblerNetworkRequest +from tribler.gui.utilities import connect, dict_item_is_any_of, get_health, tr +from tribler.gui.widgets.tablecontentmodel import Column HEALTHCHECK_DELAY_MS = 500 diff --git a/src/tribler-gui/tribler_gui/widgets/trustgraphpage.py b/src/tribler/gui/widgets/trustgraphpage.py similarity index 97% rename from src/tribler-gui/tribler_gui/widgets/trustgraphpage.py rename to src/tribler/gui/widgets/trustgraphpage.py index da4bb21b771..4b085ac90eb 100644 --- a/src/tribler-gui/tribler_gui/widgets/trustgraphpage.py +++ b/src/tribler/gui/widgets/trustgraphpage.py @@ -8,7 +8,7 @@ import pyqtgraph as pg -from tribler_gui.defs import ( +from tribler.gui.defs import ( COLOR_DEFAULT, COLOR_GREEN, COLOR_NEUTRAL, @@ -19,9 +19,9 @@ TB, TRUST_GRAPH_PEER_LEGENDS, ) -from tribler_gui.sentry_mixin import AddBreadcrumbOnShowMixin -from tribler_gui.tribler_request_manager import TriblerNetworkRequest -from tribler_gui.utilities import connect, format_size, html_label, tr +from tribler.gui.sentry_mixin import AddBreadcrumbOnShowMixin +from tribler.gui.tribler_request_manager import TriblerNetworkRequest +from tribler.gui.utilities import connect, format_size, html_label, tr class TrustGraph(pg.GraphItem): diff --git a/src/tribler-gui/tribler_gui/widgets/trustpage.py b/src/tribler/gui/widgets/trustpage.py similarity index 91% rename from src/tribler-gui/tribler_gui/widgets/trustpage.py rename to src/tribler/gui/widgets/trustpage.py index c40e4c56025..b65b3dc67bd 100644 --- a/src/tribler-gui/tribler_gui/widgets/trustpage.py +++ b/src/tribler/gui/widgets/trustpage.py @@ -2,12 +2,12 @@ from PyQt5.QtWidgets import QWidget -from tribler_gui.defs import PB, TB -from tribler_gui.dialogs.trustexplanationdialog import TrustExplanationDialog -from tribler_gui.sentry_mixin import AddBreadcrumbOnShowMixin -from tribler_gui.tribler_request_manager import TriblerNetworkRequest -from tribler_gui.utilities import connect -from tribler_gui.widgets.graphs.dataplot import TimeSeriesDataPlot +from tribler.gui.defs import PB, TB +from tribler.gui.dialogs.trustexplanationdialog import TrustExplanationDialog +from tribler.gui.sentry_mixin import AddBreadcrumbOnShowMixin +from tribler.gui.tribler_request_manager import TriblerNetworkRequest +from tribler.gui.utilities import connect +from tribler.gui.widgets.graphs.dataplot import TimeSeriesDataPlot class TrustSeriesPlot(TimeSeriesDataPlot): diff --git a/src/tribler-gui/tribler_gui/widgets/underlinetabbutton.py b/src/tribler/gui/widgets/underlinetabbutton.py similarity index 100% rename from src/tribler-gui/tribler_gui/widgets/underlinetabbutton.py rename to src/tribler/gui/widgets/underlinetabbutton.py diff --git a/src/tribler-core/run_tribler_upgrader.py b/src/tribler/run_tribler_upgrader.py similarity index 83% rename from src/tribler-core/run_tribler_upgrader.py rename to src/tribler/run_tribler_upgrader.py index d75b29b2678..1897f4f273d 100755 --- a/src/tribler-core/run_tribler_upgrader.py +++ b/src/tribler/run_tribler_upgrader.py @@ -2,13 +2,13 @@ import signal import sys -from tribler_core.components.key.key_component import KeyComponent -from tribler_core.config.tribler_config import TriblerConfig -from tribler_core.logger.logger import load_logger_config -from tribler_core.start_core import CONFIG_FILE_NAME -from tribler_core.upgrade.upgrade import TriblerUpgrader -from tribler_core.upgrade.version_manager import VersionHistory -from tribler_core.utilities.path_util import Path +from tribler.core.components.key.key_component import KeyComponent +from tribler.core.config.tribler_config import TriblerConfig +from tribler.core.logger.logger import load_logger_config +from tribler.core.start_core import CONFIG_FILE_NAME +from tribler.core.upgrade.upgrade import TriblerUpgrader +from tribler.core.upgrade.version_manager import VersionHistory +from tribler.core.utilities.path_util import Path logger = logging.getLogger(__name__) diff --git a/tribler.spec b/tribler.spec index b79594c829e..963a013ebdf 100644 --- a/tribler.spec +++ b/tribler.spec @@ -15,15 +15,13 @@ root_dir = os.path.abspath(os.path.dirname(__name__)) src_dir = os.path.join(root_dir, "src") tribler_components = [ - os.path.join(src_dir, "pyipv8"), - os.path.join(src_dir, "tribler-core"), - os.path.join(src_dir, "tribler-gui"), + os.path.join(src_dir, "tribler"), ] for component in tribler_components: sys.path.append(str(component)) -from tribler_core.version import version_id +from tribler.core.version import version_id version_str = version_id.split('-')[0] # On macOS, we always show the console to prevent the double-dock bug (although the OS does not actually show the console). @@ -33,16 +31,16 @@ if sys.platform == 'darwin': show_console = True widget_files = [] -for file in os.listdir(os.path.join(src_dir, "tribler-gui", "tribler_gui", "widgets")): +for file in os.listdir(os.path.join(src_dir, "tribler", "gui", "widgets")): if file.endswith(".py"): - widget_files.append('tribler_gui.widgets.%s' % file[:-3]) + widget_files.append('tribler.gui.widgets.%s' % file[:-3]) data_to_copy = [ - (os.path.join(src_dir, "tribler-gui", "tribler_gui", "qt_resources"), 'qt_resources'), - (os.path.join(src_dir, "tribler-gui", "tribler_gui", "images"), 'images'), - (os.path.join(src_dir, "tribler-gui", "tribler_gui", "i18n"), 'i18n'), - (os.path.join(src_dir, "tribler-core", "tribler_core"), 'tribler_source/tribler_core'), - (os.path.join(src_dir, "tribler-gui", "tribler_gui"), 'tribler_source/tribler_gui'), + (os.path.join(src_dir, "tribler", "gui", "qt_resources"), 'qt_resources'), + (os.path.join(src_dir, "tribler", "gui", "images"), 'images'), + (os.path.join(src_dir, "tribler", "gui", "i18n"), 'i18n'), + (os.path.join(src_dir, "tribler", "core"), 'tribler_source/tribler/core'), + (os.path.join(src_dir, "tribler", "gui"), 'tribler_source/tribler/gui'), (os.path.join(root_dir, "build", "win", "resources"), 'tribler_source/resources'), (os.path.dirname(aiohttp_apispec.__file__), 'aiohttp_apispec') ]