Skip to content

Commit

Permalink
feat: more user feedback from fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
Jhsmit committed Jan 11, 2024
1 parent ddb4d5e commit b7d05ae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pyhdx/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit b7d05ae

Please sign in to comment.