Skip to content

Commit

Permalink
feat: get_all_children ジェネレータを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
yupix committed Nov 25, 2023
1 parent 48b2ede commit 179da5e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mipac/actions/note.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ async def get_children(
)
return [Note(note, self._client) for note in notes]

async def get_all_children(
self,
since_id: str | None = None,
untilId: str | None = None,
note_id: str | None = None,
) -> AsyncGenerator[Note, None] | list[Note]:
limit = 100

note_id = note_id or self._note_id

Expand All @@ -173,7 +180,7 @@ async def get_children(
for note in res_notes:
yield Note(note, self._client)

if get_all is False or pagination.is_final:
if pagination.is_final:
break

async def get_state(self, note_id: str | None = None) -> NoteState:
Expand Down

0 comments on commit 179da5e

Please sign in to comment.