Skip to content

Commit

Permalink
now initializing with leave=False, and using clear() to clean up the …
Browse files Browse the repository at this point in the history
…bar afterwards
  • Loading branch information
jspaaks committed Mar 16, 2021
1 parent e56710c commit 889514d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fairtally/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def cli(urls, input_file, output_format, output_filename):
sys.exit(1)

url_progressbar = tqdm(all_urls, bar_format="fairtally progress: |{bar}| {n_fmt}/{total_fmt}", ncols=70, position=0)
current_value = tqdm(total=0, bar_format="{desc}", position=1)
current_value = tqdm(total=0, bar_format="{desc}", position=1, leave=False)
results = [check_url(url, current_value) for url in url_progressbar]

if output_filename == DEFAULT_OUTPUT_FILENAME and output_format == "json":
Expand All @@ -48,6 +48,6 @@ def cli(urls, input_file, output_format, output_filename):
click.echo("Unsupported format", err=True)
sys.exit(1)

current_value.clear()
msg = f"Completed fairtally on {len(all_urls)} URLs and written report to {output_filename}"
current_value.set_description_str(msg)
current_value.close()
click.echo(msg, err=True)

0 comments on commit 889514d

Please sign in to comment.