From fd1b8fc620a6454c944a0ced177101a4a838fd5c Mon Sep 17 00:00:00 2001 From: Vlad Savelyev Date: Tue, 16 Apr 2024 15:54:23 +0200 Subject: [PATCH] Progress bar in notebooks: fit screen and use stdout --- multiqc/utils/report.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/multiqc/utils/report.py b/multiqc/utils/report.py index 77dc6e9a69..69b43578b9 100644 --- a/multiqc/utils/report.py +++ b/multiqc/utils/report.py @@ -9,6 +9,7 @@ import mimetypes import os import re +import sys import tempfile import time from collections import defaultdict @@ -314,8 +315,9 @@ def add_file(fn, root): total=len(searchfiles), desc="Searching", unit="file", + file=sys.stdout, disable=config.no_ansi or config.quiet, - bar_format=f"{BLUE}| {'searching':>17} {RESET}| " + "{bar} {percentage:3.0f}% {n_fmt}/{total_fmt} {desc}", + bar_format=f"{BLUE}| {'searching':>17} {RESET}| " + "{bar:50} {percentage:3.0f}% {n_fmt}/{total_fmt} {desc}", ) as pbar: for i, sf in enumerate(searchfiles): # Update the progress bar description with the file being searched