Files
37duAutomation/plugins/XQ0001-0100/XQ0084 银行卡更新EHR系统/_pack.py
T
puddy 3fab00ad92 feat(sdk): hr_sdk 0.2.4 工资卡导入、desktopauto 0.5.0 证件照识别、新增插件 XQ0084
- hr_sdk.wage_import:DrissionPage 注入 cookie 打开 HR 门户,页面内 WS 订阅 + fetch 上传,解析 over: 结果;build_xlsx 第 9 列卡号强制数值(修复「卡号必须是数字」)

- 纯 HTTP 导入不可用:服务端异步任务与浏览器会话强绑定,且前端无轮询接口(已核实),结果通道只能用浏览器上下文

- desktopauto 0.5.0 新增 cardocr:身份证/银行卡 OCR、号码纠错、Luhn 与模 11-2 校验、交叉核对

- 新增插件 XQ0084 银行卡更新EHR系统:AI 表格待处理行 → 影像识别 → 一致性核对/异常名单

- .gitignore 忽略 tests/aitable_probe/_out/(含员工证件照,禁止入库)
2026-11-17 17:48:37 +08:00

37 lines
1.2 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.
# -*- coding: utf-8 -*-
"""发布打包辅助(`_` 前缀,运行时不会被插件扫描加载)。
把插件压成 dist-plugin/xq0084_v<版本>.zip(zip 根含 plugin.json)。
排除:__pycache__、_selftest*、本脚本、*.pyc。
"""
import json
import zipfile
from pathlib import Path
_HERE = Path(__file__).resolve().parent
_OUT_DIR = _HERE.parents[2] / "dist-plugin"
_EXCLUDE_DIRS = {"__pycache__", "debug", ".sessions", "out", "images"}
_EXCLUDE_FILES = {"_pack.py"}
_EXCLUDE_PREFIXES = ("_selftest",)
def main():
manifest = json.loads((_HERE / "plugin.json").read_text(encoding="utf-8"))
pid, ver = manifest["id"], manifest["version"]
_OUT_DIR.mkdir(exist_ok=True)
out = _OUT_DIR / f"{pid}_v{ver}.zip"
with zipfile.ZipFile(out, "w", zipfile.ZIP_DEFLATED) as zf:
for p in sorted(_HERE.rglob("*")):
rel = p.relative_to(_HERE)
if set(rel.parts) & _EXCLUDE_DIRS or p.name in _EXCLUDE_FILES:
continue
if p.name.startswith(_EXCLUDE_PREFIXES) or p.suffix == ".pyc":
continue
if p.is_file():
zf.write(p, str(rel))
print(f"已打包: {out}({out.stat().st_size / 1024:.0f} KB)")
if __name__ == "__main__":
main()