Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Components cleanup #6391

Merged
merged 2 commits into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@

from tribler_common.simpledefs import STATEDIR_DB_DIR

from tribler_core.components.base import Component
from tribler_core.components.ipv8 import Ipv8Component
from tribler_core.components.reporter import ReporterComponent
from tribler_core.components.restapi import RestfulComponent
from tribler_core.components.upgrade import UpgradeComponent
from tribler_core.components.bandwidth_accounting.community.community import (
BandwidthAccountingCommunity,
BandwidthAccountingTestnetCommunity,
)
from tribler_core.components.bandwidth_accounting.db.database import BandwidthDatabase
from tribler_core.restapi.rest_manager import RESTManager
from tribler_core.components.ipv8 import Ipv8Component
from tribler_core.components.restapi import RestfulComponent
from tribler_core.components.upgrade import UpgradeComponent


class BandwidthAccountingComponent(RestfulComponent):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

from ipv8_service import IPv8

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 import Ipv8Component
from tribler_core.components.gigachannel.community.gigachannel_community import GigaChannelCommunity, \
GigaChannelTestnetCommunity
from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent
from tribler_core.components.reporter import ReporterComponent
from tribler_core.components.restapi import RestfulComponent
from tribler_core.components.gigachannel.community.sync_strategy import RemovePeers
from tribler_core.restapi.rest_manager import RESTManager

INFINITE = -1

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from tribler_core.components.base import Component
from tribler_core.components.gigachannel_manager.gigachannel_manager import GigaChannelManager
from tribler_core.components.libtorrent import LibtorrentComponent
from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent
from tribler_core.components.reporter import ReporterComponent
from tribler_core.components.restapi import RestfulComponent
from tribler_core.components.gigachannel_manager.gigachannel_manager import GigaChannelManager
from tribler_core.restapi.rest_manager import RESTManager


class GigachannelManagerComponent(RestfulComponent):
Expand Down
5 changes: 2 additions & 3 deletions src/tribler-core/tribler_core/components/ipv8.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
from ipv8.peerdiscovery.community import DiscoveryCommunity, PeriodicSimilarity
from ipv8.peerdiscovery.discovery import RandomWalk
from ipv8.taskmanager import TaskManager

from ipv8_service import IPv8
from tribler_core.components.base import Component

from tribler_core.components.masterkey import MasterKeyComponent
from tribler_core.components.reporter import ReporterComponent
from tribler_core.components.restapi import RestfulComponent
from tribler_core.restapi.rest_manager import RESTManager

INFINITE = -1

Expand Down
3 changes: 0 additions & 3 deletions src/tribler-core/tribler_core/components/libtorrent.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
from tribler_common.simpledefs import STATE_CHECKPOINTS_LOADED, STATE_LOAD_CHECKPOINTS, STATE_START_LIBTORRENT

from tribler_core.components.base import Component
from tribler_core.components.masterkey import MasterKeyComponent
from tribler_core.components.reporter import ReporterComponent
from tribler_core.components.restapi import RestfulComponent
from tribler_core.components.socks_configurator import SocksServersComponent
from tribler_core.components.upgrade import UpgradeComponent
from tribler_core.modules.libtorrent.download_manager import DownloadManager
from tribler_core.restapi.rest_manager import RESTManager


class LibtorrentComponent(RestfulComponent):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
from tribler_common.simpledefs import NTFY, STATEDIR_DB_DIR

from tribler_core.components.base import Component
from tribler_core.components.masterkey import MasterKeyComponent
from tribler_core.components.reporter import ReporterComponent
from tribler_core.components.restapi import RestfulComponent
from tribler_core.components.upgrade import UpgradeComponent
from tribler_core.components.metadata_store.db.store import MetadataStore
from tribler_core.components.metadata_store.utils import generate_test_channels
from tribler_core.restapi.rest_manager import RESTManager
from tribler_core.components.restapi import RestfulComponent
from tribler_core.components.upgrade import UpgradeComponent


class MetadataStoreComponent(RestfulComponent):
Expand Down
2 changes: 0 additions & 2 deletions src/tribler-core/tribler_core/components/resource_monitor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from tribler_core.components.base import Component
from tribler_core.components.reporter import ReporterComponent
from tribler_core.components.restapi import RestfulComponent
from tribler_core.components.upgrade import UpgradeComponent
from tribler_core.modules.resource_monitor.core import CoreResourceMonitor
Expand Down
4 changes: 1 addition & 3 deletions src/tribler-core/tribler_core/components/torrent_checker.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
from tribler_common.simpledefs import STATE_START_TORRENT_CHECKER

from tribler_core.components.base import Component
from tribler_core.components.libtorrent import LibtorrentComponent
from tribler_core.components.metadata_store.metadata_store_component import MetadataStoreComponent
from tribler_core.components.reporter import ReporterComponent
from tribler_core.components.restapi import RestfulComponent
from tribler_core.components.socks_configurator import SocksServersComponent
from tribler_core.modules.torrent_checker.torrent_checker import TorrentChecker
from tribler_core.modules.torrent_checker.tracker_manager import TrackerManager
from tribler_core.restapi.rest_manager import RESTManager


class TorrentCheckerComponent(RestfulComponent):
Expand All @@ -31,6 +28,7 @@ async def run(self):
socks_listen_ports=socks_servers_component.socks_ports,
metadata_store=metadata_store_component.mds)
self.torrent_checker = torrent_checker
await self.set_readable_status(STATE_START_TORRENT_CHECKER)
await torrent_checker.initialize()
await self.init_endpoints(endpoints=['metadata'], values={'torrent_checker': torrent_checker})

Expand Down
4 changes: 2 additions & 2 deletions src/tribler-core/tribler_core/components/tunnels.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from ipv8.dht.provider import DHTCommunityProvider
from ipv8.messaging.anonymization.community import TunnelSettings
from ipv8.peerdiscovery.discovery import RandomWalk

from ipv8_service import IPv8

from tribler_core.components.bandwidth_accounting.bandwidth_accounting_component import BandwidthAccountingComponent
from tribler_core.components.base import Component
from tribler_core.components.ipv8 import Ipv8Component
from tribler_core.components.libtorrent import LibtorrentComponent
from tribler_core.components.reporter import ReporterComponent
from tribler_core.components.restapi import RestfulComponent
from tribler_core.components.socks_configurator import SocksServersComponent
from tribler_core.modules.tunnel.community.community import TriblerTunnelCommunity, TriblerTunnelTestnetCommunity
Expand Down
2 changes: 0 additions & 2 deletions src/tribler-core/tribler_core/components/upgrade.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from tribler_common.simpledefs import STATE_UPGRADING_READABLE

from tribler_core.components.base import Component
from tribler_core.components.masterkey import MasterKeyComponent
from tribler_core.components.reporter import ReporterComponent
from tribler_core.components.restapi import RestfulComponent
from tribler_core.upgrade.upgrade import TriblerUpgrader

Expand Down
2 changes: 0 additions & 2 deletions src/tribler-core/tribler_core/components/watch_folder.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from tribler_common.simpledefs import STATE_START_WATCH_FOLDER

from tribler_core.components.base import Component
from tribler_core.components.libtorrent import LibtorrentComponent
from tribler_core.components.reporter import ReporterComponent
from tribler_core.components.restapi import RestfulComponent
from tribler_core.modules.watch_folder.watch_folder import WatchFolder

Expand Down