From 363fab3e416a234eb586245c1d980af67cbb642c Mon Sep 17 00:00:00 2001 From: slu Date: Mon, 6 May 2024 10:03:57 +0200 Subject: [PATCH] [Confluence] forward start and limit for getting attachments --- atlassian/confluence.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/atlassian/confluence.py b/atlassian/confluence.py index f195ae2fd..9cb45a7f1 100644 --- a/atlassian/confluence.py +++ b/atlassian/confluence.py @@ -1322,17 +1322,20 @@ def attach_file( comment=comment, ) - def download_attachments_from_page(self, page_id, path=None): + def download_attachments_from_page(self, page_id, path=None, start=0, limit=50): """ Downloads all attachments from a page :param page_id: - :param path: path to directory where attachments will be saved. If None, current working directory will be used. + :param path: OPTIONAL: path to directory where attachments will be saved. If None, current working directory will be used. + :param start: OPTIONAL: The start point of the collection to return. Default: None (0). + :param limit: OPTIONAL: The limit of the number of attachments to return, this may be restricted by + fixed system limits. Default: 50 :return info message: number of saved attachments + path to directory where attachments were saved: """ if path is None: path = os.getcwd() try: - attachments = self.get_attachments_from_content(page_id=page_id)["results"] + attachments = self.get_attachments_from_content(page_id=page_id, start=start, limit=limit)["results"] if not attachments: return "No attachments found" for attachment in attachments: