@@ -1438,7 +1438,7 @@ def download_attachments_from_page(self, page_id, path=None, start=0, limit=50,
14381438 # Fetch specific file by filename
14391439 attachments = self .get_attachments_from_content (page_id = page_id , filename = filename )["results" ]
14401440 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 )
14421442 else :
14431443 # Fetch all attachments with pagination
14441444 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,
14721472 return {"attachments_downloaded" : len (attachments ), "path" : path }
14731473
14741474 except NotADirectoryError :
1475- raise FileNotFoundError (f "The directory '{ path } ' does not exist." )
1475+ raise FileNotFoundError ("The directory '{path}' does not exist." . format ( path = path ) )
14761476 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 ) )
14781478 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 ) )
14801480 except Exception as err :
1481- raise Exception (f "An unexpected error occurred: { err } " )
1481+ raise Exception ("An unexpected error occurred: {error}" . format ( error = err ) )
14821482
14831483 def delete_attachment (self , page_id , filename , version = None ):
14841484 """
@@ -2749,23 +2749,23 @@ def get_atl_request(url: str):
27492749 )
27502750 if export_type == "csv" :
27512751 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 ) ),
27532753 "exportType" : "TYPE_CSV" ,
27542754 "contentOption" : "all" ,
27552755 "includeComments" : "true" ,
27562756 "confirm" : "Export" ,
27572757 }
27582758 elif export_type == "html" :
27592759 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 ) ),
27612761 "exportType" : "TYPE_HTML" ,
27622762 "contentOption" : "visibleOnly" ,
27632763 "includeComments" : "true" ,
27642764 "confirm" : "Export" ,
27652765 }
27662766 elif export_type == "xml" :
27672767 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 ) ),
27692769 "exportType" : "TYPE_XML" ,
27702770 "contentOption" : "all" ,
27712771 "includeComments" : "true" ,
@@ -2777,7 +2777,7 @@ def get_atl_request(url: str):
27772777 return self .get_pdf_download_url_for_confluence_cloud (url )
27782778 else :
27792779 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 ) )
27812781
27822782 # Sending a POST request that triggers the space export.
27832783 response = self .session .post (url , headers = self .form_token_headers , data = form_data )
0 commit comments