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 c60ef94 commit e55caf3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion files/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ 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)
urllib.request.urlretrieve(download_url, new_file_path)
from tqdm import tqdm

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))

@staticmethod
def get_output_file_name(download_url, file, output_folder):
Expand Down

0 comments on commit e55caf3

Please sign in to comment.