添加dummy gateway
This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user