Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lingering progressbar text #81

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ docs/apidocs

# Mac
.DS_Store

# fairtally default output file with results
/tally.html

# virtual environment
/venv3
6 changes: 4 additions & 2 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 @@ -49,4 +49,6 @@ def cli(urls, input_file, output_format, output_filename):
sys.exit(1)

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