Skip to content

Commit

Permalink
Update files/files.py
Browse files Browse the repository at this point in the history
Co-authored-by: codiumai-pr-agent-pro[bot] <151058649+codiumai-pr-agent-pro[bot]@users.noreply.github.com>
  • Loading branch information
ypriverol and qodo-merge-pro[bot] authored Sep 25, 2024
1 parent 10c8990 commit 2f52e85
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion files/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ def download_files_from_ftp(file_list_json, output_folder):
download_url = file['publicFileLocations'][1]['value']
logging.debug('ftp_filepath:' + download_url)
new_file_path = Files.get_output_file_name(download_url, file, output_folder)
from tqdm import tqdm
with urllib.request.urlopen(download_url) as response, open(new_file_path, 'wb') as out_file:
shutil.copyfileobj(response, out_file)

with tqdm(unit='B', unit_scale=True, unit_divisor=1024, miniters=1, desc=file['accession']) as progress_bar:
urllib.request.urlretrieve(download_url, new_file_path, reporthook=lambda blocks, block_size, total_size: progress_bar.update(block_size))
Expand Down

0 comments on commit 2f52e85

Please sign in to comment.