GUI: Cosmetic fixes for stdout/stderr queues

This commit is contained in:
deajan 2024-05-14 00:21:05 +02:00
parent 0ed0f2ceac
commit 24f16be8b3
2 changed files with 4 additions and 2 deletions

View file

@ -330,9 +330,9 @@ class NPBackupRunner:
if msg is None:
raise ValueError("None log message received")
if self.stdout and (level == "info" or (level == "debug" and _DEBUG)):
self.stdout.put(msg)
self.stdout.put(f"\n{msg}")
if self.stderr and level in ("critical", "error", "warning"):
self.stderr.put(msg)
self.stderr.put(f"\n{msg}")
if raise_error == "ValueError":
raise ValueError(msg)

View file

@ -258,6 +258,7 @@ def gui_thread_runner(
if stdout_data is None:
logger.debug("gui_thread_runner got stdout queue close signal")
read_stdout_queue = False
progress_window["-OPERATIONS-PROGRESS-STDOUT-"].Update("\n", append=True)
else:
progress_window["-OPERATIONS-PROGRESS-STDOUT-"].Update(
f"\n{stdout_data}", append=True
@ -273,6 +274,7 @@ def gui_thread_runner(
if stderr_data is None:
logger.debug("gui_thread_runner got stderr queue close signal")
read_stderr_queue = False
progress_window["-OPERATIONS-PROGRESS-STDERR-"].Update("\n", append=True)
else:
stderr_has_messages = True
# if __compact: