@@ -1438,7 +1438,7 @@ def download_attachments_from_page(self, page_id, path=None, start=0, limit=50,
1438
1438
# Fetch specific file by filename
1439
1439
attachments = self .get_attachments_from_content (page_id = page_id , filename = filename )["results" ]
1440
1440
if not attachments :
1441
- return f "No attachment with filename '{ filename } ' found on the page."
1441
+ return "No attachment with filename '{0 }' found on the page." . format ( filename )
1442
1442
else :
1443
1443
# Fetch all attachments with pagination
1444
1444
attachments = self .get_attachments_from_content (page_id = page_id , start = start , limit = limit )["results" ]
@@ -1472,13 +1472,13 @@ def download_attachments_from_page(self, page_id, path=None, start=0, limit=50,
1472
1472
return {"attachments_downloaded" : len (attachments ), "path" : path }
1473
1473
1474
1474
except NotADirectoryError :
1475
- raise FileNotFoundError (f "The directory '{ path } ' does not exist." )
1475
+ raise FileNotFoundError ("The directory '{path}' does not exist." . format ( path = path ) )
1476
1476
except PermissionError :
1477
- raise PermissionError (f "Permission denied when trying to save files to '{ path } '." )
1477
+ raise PermissionError ("Permission denied when trying to save files to '{path}'." . format ( path = path ) )
1478
1478
except requests .HTTPError as http_err :
1479
- raise Exception (f "HTTP error occurred while downloading attachments: { http_err } " )
1479
+ raise Exception ("HTTP error occurred while downloading attachments: {http_err}" . format ( http_err = http_err ) )
1480
1480
except Exception as err :
1481
- raise Exception (f "An unexpected error occurred: { err } " )
1481
+ raise Exception ("An unexpected error occurred: {error}" . format ( error = err ) )
1482
1482
1483
1483
def delete_attachment (self , page_id , filename , version = None ):
1484
1484
"""
@@ -2749,23 +2749,23 @@ def get_atl_request(url: str):
2749
2749
)
2750
2750
if export_type == "csv" :
2751
2751
form_data = {
2752
- "atl_token" : get_atl_request (f "spaces/exportspacecsv.action?key={ space_key } " ),
2752
+ "atl_token" : get_atl_request ("spaces/exportspacecsv.action?key={space_key}" . format ( space_key = space_key ) ),
2753
2753
"exportType" : "TYPE_CSV" ,
2754
2754
"contentOption" : "all" ,
2755
2755
"includeComments" : "true" ,
2756
2756
"confirm" : "Export" ,
2757
2757
}
2758
2758
elif export_type == "html" :
2759
2759
form_data = {
2760
- "atl_token" : get_atl_request (f "spaces/exportspacehtml.action?key={ space_key } " ),
2760
+ "atl_token" : get_atl_request ("spaces/exportspacehtml.action?key={space_key}" . format ( space_key = space_key ) ),
2761
2761
"exportType" : "TYPE_HTML" ,
2762
2762
"contentOption" : "visibleOnly" ,
2763
2763
"includeComments" : "true" ,
2764
2764
"confirm" : "Export" ,
2765
2765
}
2766
2766
elif export_type == "xml" :
2767
2767
form_data = {
2768
- "atl_token" : get_atl_request (f "spaces/exportspacexml.action?key={ space_key } " ),
2768
+ "atl_token" : get_atl_request ("spaces/exportspacexml.action?key={space_key}" . format ( space_key = space_key ) ),
2769
2769
"exportType" : "TYPE_XML" ,
2770
2770
"contentOption" : "all" ,
2771
2771
"includeComments" : "true" ,
@@ -2777,7 +2777,7 @@ def get_atl_request(url: str):
2777
2777
return self .get_pdf_download_url_for_confluence_cloud (url )
2778
2778
else :
2779
2779
raise ValueError ("Invalid export_type parameter value. Valid values are: 'html/csv/xml/pdf'" )
2780
- url = self .url_joiner (url = self .url , path = f "spaces/doexportspace.action?key={ space_key } " )
2780
+ url = self .url_joiner (url = self .url , path = "spaces/doexportspace.action?key={space_key}" . format ( space_key = space_key ) )
2781
2781
2782
2782
# Sending a POST request that triggers the space export.
2783
2783
response = self .session .post (url , headers = self .form_token_headers , data = form_data )
0 commit comments