Files
manual_slop/debug_gui2.py

23 lines
816 B
Python

with open("src/gui_2.py", "r", encoding="utf-8", newline="") as f:
content = f.read()
# Add debug to _gui_func to see if tasks are being processed
old = """# Process GUI task queue
self._process_pending_gui_tasks()"""
new = """# Process GUI task queue
# DEBUG: Check if tasks exist before processing
if hasattr(self, 'controller') and hasattr(self.controller, '_pending_gui_tasks'):
pending_count = len(self.controller._pending_gui_tasks)
if pending_count > 0:
sys.stderr.write(f"[DEBUG gui_2] _gui_func: found {pending_count} pending tasks\\n")
sys.stderr.flush()
self._process_pending_gui_tasks()"""
content = content.replace(old, new)
with open("src/gui_2.py", "w", encoding="utf-8", newline="") as f:
f.write(content)
print("Added debug to gui_2.py")