lastone
This commit is contained in:
@@ -287,20 +287,6 @@ def build_file_associations(
|
||||
return {"items": result}
|
||||
|
||||
|
||||
def print_associations(associations: Dict, max_items: int = 10) -> None:
|
||||
"""打印关联关系预览"""
|
||||
print("\n" + "=" * 80)
|
||||
print("文件关联关系预览")
|
||||
print("=" * 80)
|
||||
|
||||
print(f"\n共 {len(associations.get('items', []))} 条记录")
|
||||
for item in associations.get('items', [])[:max_items]:
|
||||
print(f"\n {item.get('filename', '')}")
|
||||
print(f" 标题:{item.get('title', '')[:50]}...")
|
||||
print(f" URL: {item.get('url', '')}")
|
||||
print(f" 时间:{item.get('time', '')}")
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description='数据文件关联处理程序')
|
||||
parser.add_argument('--extract', action='store_true', help='解压压缩文件')
|
||||
@@ -346,7 +332,6 @@ def main():
|
||||
with open(output_file, 'w', encoding='utf-8') as f:
|
||||
json.dump(associations, f, ensure_ascii=False, indent=2)
|
||||
print(f"\n✓ 关联关系已保存到:{output_file}")
|
||||
print_associations(associations["items"])
|
||||
return
|
||||
|
||||
parser.print_help()
|
||||
|
||||
Reference in New Issue
Block a user