Update task-pipeline.py

This commit is contained in:
2026-11-04 21:53:42 +01:00
parent 69b6032c64
commit a5a3bb86d8
+15 -13
View File
@@ -1155,35 +1155,37 @@ class PipelineGUI:
shell=True, shell=True,
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, stderr=subprocess.STDOUT,
encoding="utf-8", bufsize=0,
env=env env=env
) )
current_line = "" current_line = b""
aborted = False aborted = False
while True: while True:
ch = proc.stdout.read(1) c = proc.stdout.read(1)
if isinstance(ch, bytes):
ch = ch.decode("utf-8", errors="replace") if not c:
if not ch and proc.poll() is not None:
break break
if ch == "\r":
if c == b"\r":
current_line = current_line.decode("utf-8", errors="replace")
start = self.log.index("end-1c linestart") start = self.log.index("end-1c linestart")
self.log.config(state=tk.NORMAL) self.log.config(state=tk.NORMAL)
self.log.delete(start, "end-1c") self.log.delete(start, "end-1c")
self.log.insert(start, current_line) self.log.insert(start, current_line)
self.log.config(state=tk.DISABLED) self.log.config(state=tk.DISABLED)
self.log.see(tk.END) self.log.see(tk.END)
current_line = "" current_line = b""
elif ch == "\n": elif c == b"\n":
current_line = current_line.decode("utf-8", errors="replace")
self.log.config(state=tk.NORMAL) self.log.config(state=tk.NORMAL)
self.log.insert(tk.END, current_line + "\n") self.log.insert(tk.END, current_line + "\n")
self.log.config(state=tk.DISABLED) self.log.config(state=tk.DISABLED)
self.log.see(tk.END) self.log.see(tk.END)
current_line = "" current_line = b""
else: else:
current_line += ch current_line += c
# Prüfen, ob sich Sources geändert haben # Prüfen, ob sich Sources geändert haben
if sources_dict: if sources_dict: