fix: 修复代码格式问题,提升可读性
This commit is contained in:
1 parent
71d2f218cf
commit
362b7c841c
6 files changed
+126
-35
No files matched your search
+13
-3
@@ -2759,9 +2759,19 @@ def main():
|
||||
keys = list(parsed.keys())
|
||||
for k in keys:
|
||||
try:
|
||||
v = parsed.get(k, ["", ""]) or ["", ""]
|
||||
title = (v[0] or "").strip() or "-"
|
||||
title_raw = (v[1] or "").strip() or "-"
|
||||
v = parsed.get(k, {})
|
||||
if isinstance(v, dict):
|
||||
# 新格式:字典
|
||||
title = (v.get("title", "") or "").strip() or "-"
|
||||
title_raw = (v.get("title_raw", "") or "").strip() or "-"
|
||||
has_fudai = v.get("has_fudai", False)
|
||||
fudai_content = (v.get("fudai_content", "") or "").strip()
|
||||
if has_fudai and fudai_content:
|
||||
title += f" [福袋:{fudai_content[:20]}]"
|
||||
else:
|
||||
# 兼容旧格式:元组
|
||||
title = (v[0] or "").strip() or "-"
|
||||
title_raw = (v[1] or "").strip() or "-"
|
||||
except Exception:
|
||||
title, title_raw = "-", "-"
|
||||
mapping_tree.insert("", "end", values=(k, title, title_raw))
|
||||
|
||||
Reference in new issue
Block a user