From b7d05ae3a0cac8f722b63d3cde6fe16dd6742f03 Mon Sep 17 00:00:00 2001 From: Jochem Smit Date: Thu, 11 Jan 2024 11:47:38 +0100 Subject: [PATCH] feat: more user feedback from fetch --- pyhdx/cli.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyhdx/cli.py b/pyhdx/cli.py index 56d27a0e..bce8de24 100644 --- a/pyhdx/cli.py +++ b/pyhdx/cli.py @@ -73,16 +73,22 @@ def fetch(num: int = typer.Option(10, min=1, help="Maximum number of datasets to missing_datasets = [data_id for data_id in missing_datasets if data_id] failed = [] + success = [] if missing_datasets: todo = list(missing_datasets)[:num] for data_id in tqdm(todo): try: vault.fetch_dataset(data_id) + success.append(data_id) except Exception: failed.append(data_id) + else: + print("All datasets already downloaded") if failed: print(f"Failed to download: {' ,'.join(failed)}") + if success: + print(f"Downloaded: {' ,'.join(success)}") @datasets_app.command()