17 lines
336 B
Python
17 lines
336 B
Python
# utils/output_redirector.py
|
|
"""
|
|
Output redirector for capturing stdout/stderr
|
|
"""
|
|
import sys
|
|
from queue import Queue
|
|
from typing import Optional
|
|
|
|
class OutputRedirector:
|
|
def __init__(self, queue: Queue):
|
|
self.queue = queue
|
|
|
|
def write(self, string: str):
|
|
self.queue.put(string)
|
|
|
|
def flush(self):
|
|
pass |