Files
37duAutomation/tests/tianque_probe/_run_xq0079.py
T
puddy 9873eb1963 restore: 恢复 11-06~11-09 本地未提交改动
- libs: 新增 hr_sdk / hotel_report / dingtalk,更新 desktopauto
- controlplane-next: SDK 管理模块(controller/entity/migrations)与前端视图
- electron-shell: 插件同步、注册表、runner 调整
- plugins: XQ0035/XQ0041/XQ0042/XQ0045_XQ0046/XQ0048/XQ0076/XQ0078 等版本更新
- tests/tools: 新增 SDK 兼容性检查与打包工具(sdk_pack.py、sdk_compat_check.py)
2026-11-09 17:27:10 +08:00

47 lines
1.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""临时联调:按壳子方式加载 xq0079 并跑 run(login_mode=人工登录,缓存 token 有效时应直接复用)。"""
import importlib.util
import os
import sys
import tempfile
if hasattr(sys.stdout, "reconfigure"):
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
REPO = r"d:\work\code\37duAutomation"
sys.path.insert(0, os.path.join(REPO, "desktop", "electron-shell", "python"))
PLUGIN_DIR = os.path.join(REPO, "plugins", "XQ0001-0100", "XQ0079 金色湖畔扫码数据导出")
class FakeCtx:
def log(self, msg, level="INFO"):
print(f"[{level}] {msg}", flush=True)
def progress(self, pct):
pass
spec = importlib.util.spec_from_file_location(
"xq0079", os.path.join(PLUGIN_DIR, "__init__.py"),
submodule_search_locations=[PLUGIN_DIR])
mod = importlib.util.module_from_spec(spec)
sys.modules["xq0079"] = mod
spec.loader.exec_module(mod)
plugin = mod.PLUGINS.find("xq0079")
fields = {
"tq_account1": "***REMOVED***",
"tq_password1": "***REMOVED***",
"tq_account2": "",
"tq_password2": "",
"login_mode": "人工登录",
"date_from": "",
"date_to": "",
"save_dir": os.path.join(tempfile.gettempdir(), "xq0079_test"),
"debug_mode": False,
}
result = plugin.run(fields, FakeCtx())
print("\nsummary:", result.get("summary"))
for note in result.get("notes") or []:
print("note:", note)