0
0
mirror of https://github.com/ihabunek/toot.git synced 2025-06-30 22:18:36 -04:00

Style fixes

This commit is contained in:
Ivan Habunek 2025-03-06 09:58:02 +01:00
parent 0285b4ce39
commit e1f870d27a
No known key found for this signature in database
GPG Key ID: 01DB3DD0D824504C
3 changed files with 3 additions and 0 deletions

View File

@ -8,6 +8,7 @@ from toot.cli import Context, cli, json_option, pass_context
from toot.entities import List, from_dict_list
from toot.output import print_list_accounts, print_lists, print_warning
@cli.group()
def lists():
pass

View File

@ -513,6 +513,7 @@ def from_response_list(cls: Type[T], response: Response) -> t.List[T]:
"""Convert a list of nested dicts extracted from response body into a list of `cls` instances."""
return from_dict_list(cls, response.json())
def from_responses_batched(
responses: t.Iterable[Response],
cls: Type[T],

View File

@ -169,6 +169,7 @@ def get_version(name):
T = TypeVar("T")
def batched(iterable: Iterable[T], n: int) -> Generator[List[T], None, None]:
"""Batch data from the iterable into lists of length n. The last batch may
be shorter than n."""