Skip to content

Commit

Permalink
Lint&Flake
Browse files Browse the repository at this point in the history
  • Loading branch information
drew2a committed Jan 6, 2022
1 parent 8e3aa11 commit cf5596e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ async def tearDown(self):

def create_node(self, *args, **kwargs):
self.metadata_store = MetadataStore(
Path(self.temporary_directory()) / f"mds.db",
Path(self.temporary_directory()) / "mds.db",
Path(self.temporary_directory()),
default_eccrypto.generate_key("curve25519"),
disable_sync=True,
)
self.tags_db = TagDatabase(str(Path(self.temporary_directory()) / f"tags.db"))
self.tags_db = TagDatabase(str(Path(self.temporary_directory()) / "tags.db"))

kwargs['metadata_store'] = self.metadata_store
kwargs['tags_db'] = self.tags_db
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def sanitize_parameters(self, parameters):
)
@querystring_schema(RemoteQueryParameters)
async def create_remote_search_request(self, request):
self._logger.info(f'Create remote search request')
self._logger.info('Create remote search request')
# Query remote results from the GigaChannel Community.
# Results are returned over the Events endpoint.
try:
Expand Down
24 changes: 13 additions & 11 deletions src/tribler-gui/tribler_gui/widgets/searchresultswidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
from PyQt5 import uic

from tribler_common.utilities import Query, to_fts_query

from tribler_core.components.metadata_store.db.serialization import CHANNEL_TORRENT, COLLECTION_NODE, REGULAR_TORRENT

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
Expand All @@ -23,11 +25,11 @@ def format_search_loading_label(search_request):
}

return (
tr(
"Remote responses: %(num_complete_peers)i / %(total_peers)i"
"\nNew remote results received: %(num_remote_results)i"
)
% data
tr(
"Remote responses: %(num_complete_peers)i / %(total_peers)i"
"\nNew remote results received: %(num_remote_results)i"
)
% data
)


Expand Down Expand Up @@ -99,9 +101,9 @@ def show_results(self, *_):

def check_can_show(self, query):
if (
self.last_search_query == query
and self.last_search_time is not None
and time.time() - self.last_search_time < 1
self.last_search_query == query
and self.last_search_time is not None
and time.time() - self.last_search_time < 1
):
self._logger.info("Same search query already sent within 500ms so dropping this one")
return False
Expand Down Expand Up @@ -136,9 +138,9 @@ def reset(self):

def update_loading_page(self, remote_results):
if (
not self.search_request
or remote_results.get("uuid") != self.search_request.uuid
or self.currentWidget() == self.results_page
not self.search_request
or remote_results.get("uuid") != self.search_request.uuid
or self.currentWidget() == self.results_page
):
return
peer = remote_results["peer"]
Expand Down

0 comments on commit cf5596e

Please sign in to comment.