File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -387,8 +387,8 @@ def download_file(
387387 Callback = progress_callback ,
388388 )
389389 else :
390- with _get_progress ( _S3Action . DOWNLOADING ) as progress :
391- if verbose is True :
390+ if verbose is True :
391+ with _get_progress ( _S3Action . DOWNLOADING ) as progress :
392392 progress .start ()
393393 task_id = progress .add_task (
394394 "download" ,
@@ -399,14 +399,18 @@ def download_file(
399399 def _call_back (bytes_in_chunk ):
400400 progress .update (task_id , advance = bytes_in_chunk )
401401
402- else :
403- _call_back = None
404-
402+ client .download_file (
403+ Bucket = token .get_bucket (),
404+ Filename = to_file ,
405+ Key = token .get_s3_key (),
406+ Callback = _call_back ,
407+ )
408+ else :
405409 client .download_file (
406410 Bucket = token .get_bucket (),
407411 Filename = to_file ,
408412 Key = token .get_s3_key (),
409- Callback = _call_back ,
413+ Callback = None ,
410414 )
411415 if verbose is True :
412416 log .info (f"Saved to { to_file } " )
You can’t perform that action at this time.
0 commit comments