feat: 新增银行卡检查插件及相关依赖与配置文件

This commit is contained in:
2026-10-29 14:21:30 +08:00
parent 259369953f
commit 526116af83
494 changed files with 66923 additions and 2714 deletions
+27
View File
@@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
"""XQ0033 插件 - 新增段历史记录(_xq0033_state.json)。
结构:{数据文件名: {"new_dates": ["YYYY-MM-DD", ...]}}
删除旧修正行时跳过这些日期,防止误删历轮新增段。
"""
import json
import os
from .. import config
def load_state(path):
"""读取状态文件(不存在或损坏时按空处理并告警)。"""
if not path or not os.path.exists(path):
return {}
try:
with open(path, encoding="utf-8") as f:
return json.load(f) or {}
except Exception as e:
config.logger.warning("状态文件读取失败(按空历史处理):%s", e)
return {}
def save_state(path, state):
with open(path, "w", encoding="utf-8") as f:
json.dump(state, f, ensure_ascii=False, indent=2)