cli2 3.3.40__tar.gz → 3.3.41__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cli2-3.3.40/cli2.egg-info → cli2-3.3.41}/PKG-INFO +1 -1
- {cli2-3.3.40 → cli2-3.3.41}/cli2/client.py +3 -6
- {cli2-3.3.40 → cli2-3.3.41}/cli2/test_client.py +1 -2
- {cli2-3.3.40 → cli2-3.3.41/cli2.egg-info}/PKG-INFO +1 -1
- {cli2-3.3.40 → cli2-3.3.41}/setup.py +1 -1
- {cli2-3.3.40 → cli2-3.3.41}/MANIFEST.in +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/README.rst +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/classifiers.txt +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/__init__.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/argument.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/asyncio.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/cli.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/colors.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/command.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/configuration.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/decorators.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/display.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/entry_point.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/example_client.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/example_client_complex.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/example_nesting.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/example_obj.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/group.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/logging.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/node.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/overrides.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/sphinx.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/table.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/test.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/test_cli.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/test_command.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/test_configuration.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/test_decorators.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/test_display.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/test_entry_point.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/test_group.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/test_inject.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/test_node.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2/test_table.py +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2.egg-info/SOURCES.txt +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2.egg-info/dependency_links.txt +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2.egg-info/entry_points.txt +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2.egg-info/requires.txt +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/cli2.egg-info/top_level.txt +0 -0
- {cli2-3.3.40 → cli2-3.3.41}/setup.cfg +0 -0
|
@@ -70,9 +70,7 @@ class Paginator:
|
|
|
70
70
|
|
|
71
71
|
.. py:attribute:: callback
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
This must return True or the item will be filtered *out* of yielded
|
|
75
|
-
results.
|
|
73
|
+
Async callback called for every item before filtering by expressions.
|
|
76
74
|
"""
|
|
77
75
|
|
|
78
76
|
def __init__(self, client, url, params=None, model=None, expressions=None,
|
|
@@ -274,10 +272,9 @@ class Paginator:
|
|
|
274
272
|
python_filter = self.python_filter()
|
|
275
273
|
|
|
276
274
|
async def yielder(items):
|
|
275
|
+
if callback:
|
|
276
|
+
await asyncio.gather(*[callback(item) for item in items])
|
|
277
277
|
for item in items:
|
|
278
|
-
if callback:
|
|
279
|
-
if not await async_resolve(callback(item)):
|
|
280
|
-
continue
|
|
281
278
|
if not python_filter or python_filter.matches(item):
|
|
282
279
|
yield item
|
|
283
280
|
|
|
@@ -376,9 +376,8 @@ async def test_pagination(httpx_mock):
|
|
|
376
376
|
httpx_mock.add_response(url='http://lol/?page=3', json=[])
|
|
377
377
|
client = Client(base_url='http://lol')
|
|
378
378
|
|
|
379
|
-
def callback(item):
|
|
379
|
+
async def callback(item):
|
|
380
380
|
item['b'] = item['a']
|
|
381
|
-
return True
|
|
382
381
|
|
|
383
382
|
paginator = client.paginate(
|
|
384
383
|
'/',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|