fix(rdesign): run runner startup unconditionally (Scribus doesn't set __main__)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-03-24 11:53:47 -07:00
parent aacbcdaddf
commit 3a443a0d09
1 changed files with 14 additions and 16 deletions

View File

@ -320,20 +320,18 @@ def run_socket_server():
print(f"[runner] Socket error: {e}", file=sys.stderr) print(f"[runner] Socket error: {e}", file=sys.stderr)
if __name__ == "__main__": # Always run — Scribus --python-script doesn't set __name__ to "__main__"
_ensure_dirs() _ensure_dirs()
print("[runner] Scribus bridge runner starting...") print("[runner] Scribus bridge runner starting...")
# Run socket server in a thread so Scribus event loop can continue # Run socket server in a thread so Scribus event loop can continue
t = threading.Thread(target=run_socket_server, daemon=True) t = threading.Thread(target=run_socket_server, daemon=True)
t.start() t.start()
print("[runner] Socket server thread started") print("[runner] Socket server thread started")
# Keep the script alive # Keep the script alive
# When run via --python-script, Scribus will execute this then exit try:
# We need to keep it running for the socket server while True:
try: import time
while True: time.sleep(1)
import time except KeyboardInterrupt:
time.sleep(1) print("[runner] Shutting down")
except KeyboardInterrupt:
print("[runner] Shutting down")