Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
drew2a committed Oct 25, 2021
1 parent 5bd32ad commit f526086
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 84 deletions.
10 changes: 0 additions & 10 deletions src/tribler-common/tribler_common/logger/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
20 changes: 0 additions & 20 deletions src/tribler-common/tribler_common/simpledefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
15 changes: 0 additions & 15 deletions src/tribler-core/tribler_core/components/metadata_store/config.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit f526086

Please sign in to comment.