- 用 OR_SITE_CONFIG_JSON_FILE 统一术间配置(video_rtsp_urls + voice_or_room_bindings) - VoiceTerminalHub:assignment、WS 推送与 HTTP 查询;开录/停录后 notify - 一键联调 orchestrate-and-start 与 /client/surgeries/start 共用指派逻辑,修复 demo 路径不发 WS - 语音桌面端:SIGINT 退出、shutdown 清理、仅 WS 指派、固定 pending 轮询间隔、界面仅保留录音时长 - 新增/调整契约与绑定测试,文档与示例配置同步 Made-with: Cursor
36 lines
856 B
Python
36 lines
856 B
Python
"""Entry: `python -m voice_confirmation_client` or `voice-confirmation-client`."""
|
||
|
||
from __future__ import annotations
|
||
|
||
import signal
|
||
import sys
|
||
|
||
|
||
def main() -> None:
|
||
from PySide6.QtCore import QTimer
|
||
from PySide6.QtWidgets import QApplication
|
||
|
||
from voice_confirmation_client.gui.main_window import MainWindow
|
||
|
||
app = QApplication(sys.argv)
|
||
win = MainWindow()
|
||
win.show()
|
||
|
||
app.aboutToQuit.connect(win.shutdown)
|
||
|
||
# Qt 事件循环长时间跑在 native 代码里时,Python 无法处理 SIGINT;定时器让解释器周期性醒来。
|
||
_pulse = QTimer()
|
||
_pulse.timeout.connect(lambda: None)
|
||
_pulse.start(200)
|
||
|
||
def _on_sigint(_signum: int, _frame: object | None) -> None:
|
||
app.quit()
|
||
|
||
signal.signal(signal.SIGINT, _on_sigint)
|
||
|
||
raise SystemExit(app.exec())
|
||
|
||
|
||
if __name__ == "__main__":
|
||
main()
|