This commit is contained in:
revernomad17
2026-04-08 13:36:49 +07:00
parent 595544e94f
commit 5b497cf414
18 changed files with 2121 additions and 6 deletions

19
gui/_io.py Normal file
View File

@@ -0,0 +1,19 @@
from __future__ import annotations
import io
import queue
class _QueueWriter(io.TextIOBase):
"""Redirect sys.stdout / sys.stderr into a Queue for the Logs panel."""
def __init__(self, q: queue.Queue[str]) -> None:
self._q = q
def write(self, text: str) -> int: # type: ignore[override]
if text:
self._q.put(text)
return len(text)
def flush(self) -> None:
pass