Skip to content

Commit

Permalink
CLI show total assets (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjlittle authored Oct 16, 2023
1 parent 5f3d0eb commit bcdb488
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/geovista/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def _download_group(

click.echo(f"Downloading {n_fnames} {name}registered asset{_plural(n_fnames)}:")
for i, fname in enumerate(fnames):
click.echo(f"[{i+1:0{width}d}] Downloading ", nl=False)
click.echo(f"[{i+1:0{width}d}/{n_fnames}] Downloading ", nl=False)
click.secho(f"{fname} ", nl=False, fg=fg_colour)
click.echo("... ", nl=False)
CACHE.fetch(fname)
Expand Down Expand Up @@ -301,7 +301,7 @@ def collect(prefix):
unavailable = 0
click.echo("Verifying remote availability of registered assets:")
for i, fname in enumerate(fnames):
click.echo(f"[{i+1:0{width}d}] ", nl=False)
click.echo(f"[{i+1:0{width}d}/{n_fnames}] ", nl=False)
click.secho(f"{fname} ", nl=False, fg=fg_colour)
click.echo("is ... ", nl=False)
status, status_fg_colour = (
Expand Down Expand Up @@ -337,14 +337,14 @@ def collect(prefix):
if dry_run:
click.echo("URLs of registered assets:")
for i, fname in enumerate(fnames):
click.echo(f"[{i+1:0{width}d}] ", nl=False)
click.echo(f"[{i+1:0{width}d}/{n_fnames}] ", nl=False)
click.secho(f"{CACHE.get_url(fname)}", fg=fg_colour)
click.echo("\n👍 All done!")

if show:
click.echo("Names of registered assets:")
for i, fname in enumerate(fnames):
click.echo(f"[{i+1:0{width}d}] ", nl=False)
click.echo(f"[{i+1:0{width}d}/{n_fnames}] ", nl=False)
click.secho(f"{fname}", fg=fg_colour)
click.echo("\n👍 All done!")

Expand Down Expand Up @@ -389,7 +389,7 @@ def examples(run_all, show, run, verbose):
click.echo("Names of available examples:")
width = len(str(n_scripts))
for i, script in enumerate(SCRIPTS[1:]):
click.echo(f"[{i + 1:0{width}d}] ", nl=False)
click.echo(f"[{i + 1:0{width}d}/{n_scripts}] ", nl=False)
click.secho(f"{script}", fg="green")
click.echo("\n👍 All done!")
return
Expand Down

0 comments on commit bcdb488

Please sign in to comment.