Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7123147
D3668.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D3668.diff
View Options
diff --git a/swh/search/tests/test_search.py b/swh/search/tests/test_search.py
--- a/swh/search/tests/test_search.py
+++ b/swh/search/tests/test_search.py
@@ -5,7 +5,7 @@
from hypothesis import given, strategies, settings
-from swh.search.utils import stream_results
+from swh.core.api.classes import stream_results
class CommonSearchTest:
diff --git a/swh/search/utils.py b/swh/search/utils.py
deleted file mode 100644
--- a/swh/search/utils.py
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (C) 2019-2020 The Software Heritage developers
-# See the AUTHORS file at the top-level directory of this distribution
-# License: GNU General Public License version 3, or any later version
-# See top-level LICENSE file for more information
-
-
-def stream_results(f, *args, **kwargs):
- """Consume the paginated result and stream the page results
-
- """
- if "page_token" in kwargs:
- raise TypeError('stream_results has no argument "page_token".')
- page_token = None
- while True:
- page_result = f(*args, page_token=page_token, **kwargs)
- yield from page_result.results
- page_token = page_result.next_page_token
- if page_token is None:
- break
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 17, 11:54 PM (6 d, 22 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3219440
Attached To
D3668: Reuse swh.core stream_results function
Event Timeline
Log In to Comment