diff --git a/sbmy_control/low_level.py b/sbmy_control/low_level.py index 26054bf..5a32cdd 100644 --- a/sbmy_control/low_level.py +++ b/sbmy_control/low_level.py @@ -64,10 +64,14 @@ def stdout_redirector(stream): try: # Create a temporary file and redirect stdout to it tfile = tempfile.TemporaryFile(mode="w+b") + _redirect_stdout(tfile.fileno()) + # Yield to caller, then redirect stdout back to the saved fd yield + _redirect_stdout(saved_stdout_fd) + # Copy contents of temporary file to the given stream tfile.flush() tfile.seek(0, io.SEEK_SET) @@ -237,7 +241,7 @@ def progress_bar_from_logfile(filename:str, desc:str="", verbose:int=1, **kwargs from tqdm import tqdm from time import sleep k=0 - limit=600 + limit=6000 update_interval=0.2 wait_until_file_exists(filename, verbose=verbose, limit=limit) current_operation, total_operations = get_progress_from_logfile(filename)