-
Notifications
You must be signed in to change notification settings - Fork 664
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Download attachments from page (#1283)
* [Confluence] new method confluence_download_attachments_from_page * [Confluence] new method confluence_download_attachments_from_page * added example --------- Co-authored-by: gkowalc <gkowalc>
- Loading branch information
Showing
4 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
examples/confluence/confluence_download_attachments_from_page.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from atlassian import Confluence | ||
import os | ||
|
||
host = "<cloud_instance_url/wiki>" | ||
username = "<user_email>" | ||
password = "<API_TOKEN>" | ||
confluence = Confluence( | ||
url=host, | ||
username=username, | ||
password=password, | ||
) | ||
|
||
# this is the directory where the attachments will be saved. | ||
# In this example we use current working directory where script is executed + subdirectory 'attachment_tests' | ||
|
||
current_dir = os.getcwd() | ||
my_path = current_dir + "/attachment_tests" | ||
page = 393464 # make sure the page id exists and has attachments | ||
|
||
confluence.download_attachments_from_page(page) | ||
# Directory 'attachment_tests' should include saved attachment. If directory deosn't exist or if there is permission issue function should raise an error. |
Empty file.