@@ -43,7 +43,6 @@ def __init__(self, api_client: Optional[ApiClient] = None):
4343 api_client (ApiClient, optinal): osparc.ApiClient object
4444 """
4545 super ().__init__ (api_client )
46- self ._super = super (FilesApi , self )
4746 user : Optional [str ] = self .api_client .configuration .username
4847 passwd : Optional [str ] = self .api_client .configuration .password
4948 self ._auth : Optional [httpx .BasicAuth ] = (
@@ -53,13 +52,13 @@ def __init__(self, api_client: Optional[ApiClient] = None):
5352 )
5453
5554 def download_file (
56- self , file_id : str , * , destination_folder : Optional [Path ] = None
55+ self , file_id : str , * , destination_folder : Optional [Path ] = None , ** kwargs
5756 ) -> str :
5857 if destination_folder is not None and not destination_folder .is_dir ():
5958 raise RuntimeError (
6059 f"destination_folder: { destination_folder } must be a directory"
6160 )
62- downloaded_file : Path = Path (super ().download_file (file_id ))
61+ downloaded_file : Path = Path (super ().download_file (file_id , ** kwargs ))
6362 if destination_folder is not None :
6463 dest_file : Path = destination_folder / downloaded_file .name
6564 while dest_file .is_file ():
@@ -74,14 +73,20 @@ def download_file(
7473 return str (downloaded_file .resolve ())
7574
7675 def upload_file (
77- self , file : Union [str , Path ], timeout_seconds : int = DEFAULT_TIMEOUT_SECONDS
76+ self ,
77+ file : Union [str , Path ],
78+ timeout_seconds : int = DEFAULT_TIMEOUT_SECONDS ,
79+ ** kwargs ,
7880 ):
7981 return asyncio .run (
80- self .upload_file_async (file = file , timeout_seconds = timeout_seconds )
82+ self .upload_file_async (file = file , timeout_seconds = timeout_seconds , ** kwargs )
8183 )
8284
8385 async def upload_file_async (
84- self , file : Union [str , Path ], timeout_seconds : int = DEFAULT_TIMEOUT_SECONDS
86+ self ,
87+ file : Union [str , Path ],
88+ timeout_seconds : int = DEFAULT_TIMEOUT_SECONDS ,
89+ ** kwargs ,
8590 ) -> File :
8691 if isinstance (file , str ):
8792 file = Path (file )
@@ -100,9 +105,9 @@ async def upload_file_async(
100105 filesize = file .stat ().st_size ,
101106 sha256_checksum = checksum ,
102107 )
103- client_upload_schema : ClientFileUploadData = self . _super .get_upload_links (
104- client_file = client_file , _request_timeout = timeout_seconds
105- ) # type: ignore
108+ client_upload_schema : ClientFileUploadData = super () .get_upload_links (
109+ client_file = client_file , _request_timeout = timeout_seconds , ** kwargs
110+ )
106111 chunk_size : int = client_upload_schema .upload_schema .chunk_size
107112 links : FileUploadData = client_upload_schema .upload_schema .links
108113 url_iter : Iterator [Tuple [int , str ]] = enumerate (
@@ -124,7 +129,7 @@ async def upload_file_async(
124129 file_chunk_generator (file , chunk_size ),
125130 total = n_urls ,
126131 disable = (not _logger .isEnabledFor (logging .INFO )),
127- ): # type: ignore
132+ ):
128133 index , url = next (url_iter )
129134 uploaded_parts .append (
130135 await self ._upload_chunck (
0 commit comments