diff --git a/src/tribler-common/tribler_common/logger/__init__.py b/src/tribler-common/tribler_common/logger/__init__.py index d44d7b28d9f..7c32cc36117 100644 --- a/src/tribler-common/tribler_common/logger/__init__.py +++ b/src/tribler-common/tribler_common/logger/__init__.py @@ -7,16 +7,6 @@ import yaml -class InfoFilter(logging.Filter): - def filter(self, rec): - return rec.levelno == logging.INFO - - -class ErrorFilter(logging.Filter): - def filter(self, rec): - return rec.levelno == logging.ERROR - - def setup_logging(config_path='config.yaml', module='core', log_dir='LOG_DIR'): """ Setup logging configuration with the given YAML file. diff --git a/src/tribler-common/tribler_common/simpledefs.py b/src/tribler-common/tribler_common/simpledefs.py index ac5cb0438f7..fa35908ddb8 100644 --- a/src/tribler-common/tribler_common/simpledefs.py +++ b/src/tribler-common/tribler_common/simpledefs.py @@ -40,26 +40,6 @@ # Infohashes are always 20 byte binary strings INFOHASH_LENGTH = 20 -# SIGNALS (for internal use) -SIGNAL_ALLCHANNEL_COMMUNITY = 'signal_allchannel_community' -SIGNAL_CHANNEL_COMMUNITY = 'signal_channel_community' -SIGNAL_SEARCH_COMMUNITY = 'signal_search_community' -SIGNAL_GIGACHANNEL_COMMUNITY = 'signal_gigachannel_community' - -SIGNAL_ON_SEARCH_RESULTS = 'signal_on_search_results' -SIGNAL_ON_TORRENT_UPDATED = 'signal_on_torrent_updated' - -# SIGNALS (for common use, like APIs) -SIGNAL_TORRENT = 'signal_torrent' -SIGNAL_CHANNEL = 'signal_channel' -SIGNAL_RSS_FEED = 'signal_rss_feed' - -SIGNAL_ON_CREATED = 'signal_on_created' -SIGNAL_ON_UPDATED = 'signal_on_updated' - -SIGNAL_RESOURCE_CHECK = 'signal_resource_check' -SIGNAL_LOW_SPACE = 'signal_low_space' - # Tribler Core states STATE_STARTING = "STARTING" STATE_UPGRADING = "UPGRADING" diff --git a/src/tribler-core/tribler_core/components/gigachannel/community/payload.py b/src/tribler-core/tribler_core/components/gigachannel/community/payload.py deleted file mode 100644 index f160bf24edb..00000000000 --- a/src/tribler-core/tribler_core/components/gigachannel/community/payload.py +++ /dev/null @@ -1,11 +0,0 @@ -from ipv8.messaging.lazy_payload import VariablePayload - - -class SearchRequestPayload(VariablePayload): - format_list = ['I', 'varlenH', 'varlenH', 'varlenH', '?', '?'] - names = ['id', 'txt_filter', 'metadata_type', 'sort_by', 'sort_asc', 'hide_xxx'] - - -class SearchResponsePayload(VariablePayload): - format_list = ['I', 'raw'] - names = ['id', 'raw_blob'] diff --git a/src/tribler-core/tribler_core/components/gigachannel/community/request.py b/src/tribler-core/tribler_core/components/gigachannel/community/request.py index c94bffe8561..f3f99885962 100644 --- a/src/tribler-core/tribler_core/components/gigachannel/community/request.py +++ b/src/tribler-core/tribler_core/components/gigachannel/community/request.py @@ -21,25 +21,6 @@ def timeout_delay(self): def on_timeout(self): pass - def process_peer_response(self, peer): - """ - Returns whether to process this response from the given peer in the community. If the peer response has - already been processed then it is skipped. Moreover, if all the responses from the expected peers are received, - the request is removed from the request cache. - :param peer: Peer - :return: True if peer has not been processed before, else False - """ - mid = hexlify(peer.mid) - if mid in self.requested_peers and not self.requested_peers[mid]: - self.requested_peers[mid] = True - - # Check if all expected responses are received - if all(self.requested_peers.values()): - self.remove_request() - - return True - return False - def remove_request(self): if self.request_cache.has(self.prefix, self.number): try: diff --git a/src/tribler-core/tribler_core/components/metadata_store/config.py b/src/tribler-core/tribler_core/components/metadata_store/config.py deleted file mode 100644 index 75fdaf9263d..00000000000 --- a/src/tribler-core/tribler_core/components/metadata_store/config.py +++ /dev/null @@ -1,15 +0,0 @@ -from pathlib import Path - -from pydantic import BaseModel - -from tribler_common.simpledefs import STATEDIR_CHANNELS_DIR - - -class MetadataStoreConfig(BaseModel): - enabled: bool = True - manager_enabled: bool = True - channels_dir: Path = Path(STATEDIR_CHANNELS_DIR) - testnet: bool = True - - class Config: - validate_assignment = True diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/channel_metadata.py b/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/channel_metadata.py index 17d6553d5ec..aecefe06433 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/channel_metadata.py +++ b/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/channel_metadata.py @@ -447,11 +447,6 @@ def get_channels_by_title(cls, title): def get_channel_with_infohash(cls, infohash): return cls.get(infohash=infohash) - @classmethod - @db_session - def get_recent_channel_with_public_key(cls, public_key): - return cls.select(lambda g: g.public_key == public_key).sort_by(lambda g: desc(g.id_)).first() or None - @classmethod @db_session def get_channel_with_dirname(cls, dirname): diff --git a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/collection_node.py b/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/collection_node.py index dbb86a3298d..e1b09f293f6 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/collection_node.py +++ b/src/tribler-core/tribler_core/components/metadata_store/db/orm_bindings/collection_node.py @@ -126,10 +126,6 @@ def contents(self): def actual_contents(self): return self.contents.where(lambda g: g.status != TODELETE) - @db_session - def get_random_contents(self, limit): - return self.contents.where(lambda g: g.status not in [NEW, TODELETE]).random(limit) - @property @db_session def contents_list(self):