Skip to content

Commit 889514d

Browse files
committed
now initializing with leave=False, and using clear() to clean up the bar afterwards
1 parent e56710c commit 889514d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fairtally/cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def cli(urls, input_file, output_format, output_filename):
3333
sys.exit(1)
3434

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

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

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

0 commit comments

Comments
 (0)