添加dummy gateway

This commit is contained in:
2026-06-02 18:07:55 +08:00
parent 6b3b1a1f76
commit db910e03d6
5 changed files with 373 additions and 229 deletions
+25
View File
@@ -0,0 +1,25 @@
"""
QMT 模块统一入口
根据环境自动选择真实 QMT 或模拟器
"""
import sys
def _get_qmt():
"""获取 QMT 模块"""
if sys.platform == 'win32':
try:
# Windows 环境尝试导入真实 QMT
import core.qmt_real as qmt_module
return qmt_module.qmtv
except ImportError:
pass
# 非 Windows 或导入失败,使用模拟器
try:
import core.qmt_dummy as qmt_module
return qmt_module.qmtv
except ImportError:
raise ImportError("无法加载 QMT 模块")
# 导出单例
qmtv = _get_qmt()