""" Standalone Linker launcher. Eseguito come subprocess da app/suite/server.py. """ import sys import logging from pathlib import Path # Setup path: MyICR_Suite/ deve essere in sys.path _myicr_root = Path(__file__).resolve().parent.parent.parent.parent if str(_myicr_root) not in sys.path: sys.path.insert(0, str(_myicr_root)) _log_file = _myicr_root / 'logs' / 'linker.log' _log_file.parent.mkdir(exist_ok=True) logging.basicConfig( level=logging.DEBUG, format='%(asctime)s | %(levelname)-8s | %(name)s:%(funcName)s:%(lineno)d - %(message)s', handlers=[ logging.FileHandler(str(_log_file), encoding='utf-8'), ], ) logger = logging.getLogger(__name__) from PyQt6.QtWidgets import QApplication from app.modules.linker.launcher import launch_linker_window if __name__ == '__main__': try: logger.info("=== Avvio Linker ===") app = QApplication(sys.argv) app.setApplicationName('Linker') launch_linker_window(parent=None) logger.info("launch_linker_window completato, avvio event loop") sys.exit(app.exec()) except Exception as e: logger.critical(f"Crash avvio Linker: {e}", exc_info=True) raise