Skip to content

Commit bba9e38

Browse files
chillmastercoderslu
andauthored
[Confluence] forward start and limit for getting attachments (#1384)
Co-authored-by: slu <[email protected]>
1 parent e0407e6 commit bba9e38

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

atlassian/confluence.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,17 +1315,20 @@ def attach_file(
13151315
comment=comment,
13161316
)
13171317

1318-
def download_attachments_from_page(self, page_id, path=None):
1318+
def download_attachments_from_page(self, page_id, path=None, start=0, limit=50):
13191319
"""
13201320
Downloads all attachments from a page
13211321
:param page_id:
1322-
:param path: path to directory where attachments will be saved. If None, current working directory will be used.
1322+
:param path: OPTIONAL: path to directory where attachments will be saved. If None, current working directory will be used.
1323+
:param start: OPTIONAL: The start point of the collection to return. Default: None (0).
1324+
:param limit: OPTIONAL: The limit of the number of attachments to return, this may be restricted by
1325+
fixed system limits. Default: 50
13231326
:return info message: number of saved attachments + path to directory where attachments were saved:
13241327
"""
13251328
if path is None:
13261329
path = os.getcwd()
13271330
try:
1328-
attachments = self.get_attachments_from_content(page_id=page_id)["results"]
1331+
attachments = self.get_attachments_from_content(page_id=page_id, start=start, limit=limit)["results"]
13291332
if not attachments:
13301333
return "No attachments found"
13311334
for attachment in attachments:

0 commit comments

Comments
 (0)