23 lines
887 B
Python
23 lines
887 B
Python
"""Read-only full protocol probe using the installed application's data location."""
|
|
import json
|
|
import os
|
|
from pathlib import Path
|
|
import sys
|
|
|
|
sys.dont_write_bytecode = True
|
|
sys.path.insert(0, r"C:\wechat_rpa")
|
|
import runtime_paths
|
|
|
|
runtime_paths.application_data_dir = lambda: Path(os.environ["LOCALAPPDATA"]) / "ZhenYangTangRPA"
|
|
from wxwork_protocol_probe import probe_installed_client
|
|
|
|
report = probe_installed_client(deep=False, initialize_database=False)
|
|
fields = (
|
|
"status", "label", "message", "canSend", "loginVerified", "databaseReady",
|
|
"sendVerified", "receiptVerified", "clientVersion", "timingsMs", "buildValidation", "errors",
|
|
)
|
|
summary = {key: report.get(key) for key in fields}
|
|
summary["runtime"] = sys.version
|
|
Path(sys.argv[1]).write_text(json.dumps(summary, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
|
|
print(json.dumps(summary, ensure_ascii=False))
|