Skip to content

Commit 1d29eb7

Browse files
committed
Run linting
1 parent 130c83e commit 1d29eb7

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

simvue/api/objects/base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,12 +367,14 @@ def _get_all_objects(
367367
if _label.endswith("s"):
368368
_label = _label[:-1]
369369

370-
for response in get_paginated(_url, headers=_class_instance._headers, offset=offset, **kwargs):
370+
for response in get_paginated(
371+
_url, headers=_class_instance._headers, offset=offset, **kwargs
372+
):
371373
yield get_json_from_response(
372374
response=response,
373375
expected_status=[http.HTTPStatus.OK],
374376
scenario=f"Retrieval of {_label}s",
375-
) # type: ignore
377+
) # type: ignore
376378

377379
def read_only(self, is_read_only: bool) -> None:
378380
self._read_only = is_read_only

simvue/api/request.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,10 @@ def get_paginated(
282282
timeout: int = DEFAULT_API_TIMEOUT,
283283
json: dict[str, typing.Any] | None = None,
284284
offset: int | None = None,
285-
**params
285+
**params,
286286
) -> typing.Generator[requests.Response, None, None]:
287287
"""Paginate results of a server query.
288-
288+
289289
Parameters
290290
----------
291291
url : str
@@ -304,12 +304,19 @@ def get_paginated(
304304
"""
305305
_offset: int = offset or 0
306306

307-
while (_response := get(
308-
url=url,
309-
headers=headers,
310-
params=(params or {}) | {"count": MAX_ENTRIES_PER_PAGE, "start": _offset},
311-
timeout=timeout,
312-
json=json,
313-
)).json().get("data"):
307+
while (
308+
(
309+
_response := get(
310+
url=url,
311+
headers=headers,
312+
params=(params or {})
313+
| {"count": MAX_ENTRIES_PER_PAGE, "start": _offset},
314+
timeout=timeout,
315+
json=json,
316+
)
317+
)
318+
.json()
319+
.get("data")
320+
):
314321
yield _response
315322
_offset += MAX_ENTRIES_PER_PAGE

0 commit comments

Comments
 (0)