@@ -1402,7 +1402,7 @@ def attach_file(
1402
1402
1403
1403
def download_attachments_from_page (self , page_id , path = None , start = 0 , limit = 50 , filename = None , to_memory = False ):
1404
1404
"""
1405
- Downloads attachments from a Confluence page. Supports downloading all files or a specific file.
1405
+ Downloads attachments from a Confluence page. Supports downloading all files or a specific file.
1406
1406
Files can either be saved to disk or returned as BytesIO objects for in-memory handling.
1407
1407
1408
1408
:param page_id: str
@@ -2749,23 +2749,29 @@ def get_atl_request(url: str):
2749
2749
)
2750
2750
if export_type == "csv" :
2751
2751
form_data = {
2752
- "atl_token" : get_atl_request ("spaces/exportspacecsv.action?key={space_key}" .format (space_key = space_key )),
2752
+ "atl_token" : get_atl_request (
2753
+ "spaces/exportspacecsv.action?key={space_key}" .format (space_key = space_key )
2754
+ ),
2753
2755
"exportType" : "TYPE_CSV" ,
2754
2756
"contentOption" : "all" ,
2755
2757
"includeComments" : "true" ,
2756
2758
"confirm" : "Export" ,
2757
2759
}
2758
2760
elif export_type == "html" :
2759
2761
form_data = {
2760
- "atl_token" : get_atl_request ("spaces/exportspacehtml.action?key={space_key}" .format (space_key = space_key )),
2762
+ "atl_token" : get_atl_request (
2763
+ "spaces/exportspacehtml.action?key={space_key}" .format (space_key = space_key )
2764
+ ),
2761
2765
"exportType" : "TYPE_HTML" ,
2762
2766
"contentOption" : "visibleOnly" ,
2763
2767
"includeComments" : "true" ,
2764
2768
"confirm" : "Export" ,
2765
2769
}
2766
2770
elif export_type == "xml" :
2767
2771
form_data = {
2768
- "atl_token" : get_atl_request ("spaces/exportspacexml.action?key={space_key}" .format (space_key = space_key )),
2772
+ "atl_token" : get_atl_request (
2773
+ "spaces/exportspacexml.action?key={space_key}" .format (space_key = space_key )
2774
+ ),
2769
2775
"exportType" : "TYPE_XML" ,
2770
2776
"contentOption" : "all" ,
2771
2777
"includeComments" : "true" ,
@@ -2777,7 +2783,9 @@ def get_atl_request(url: str):
2777
2783
return self .get_pdf_download_url_for_confluence_cloud (url )
2778
2784
else :
2779
2785
raise ValueError ("Invalid export_type parameter value. Valid values are: 'html/csv/xml/pdf'" )
2780
- url = self .url_joiner (url = self .url , path = "spaces/doexportspace.action?key={space_key}" .format (space_key = space_key ))
2786
+ url = self .url_joiner (
2787
+ url = self .url , path = "spaces/doexportspace.action?key={space_key}" .format (space_key = space_key )
2788
+ )
2781
2789
2782
2790
# Sending a POST request that triggers the space export.
2783
2791
response = self .session .post (url , headers = self .form_token_headers , data = form_data )
0 commit comments