chore: collect latest dingTalk feishu docs
This commit is contained in:
@@ -28,33 +28,36 @@ def main():
|
||||
p.add_argument("--skip-download",action="store_true"); p.add_argument("--skip-kb",action="store_true")
|
||||
args = p.parse_args()
|
||||
t0 = time.time()
|
||||
failures = 0
|
||||
|
||||
s1 = []
|
||||
if args.full: s1.append("--full")
|
||||
elif args.since: s1 += ["--since", args.since]
|
||||
elif args.days: s1 += ["--days", str(args.days)]
|
||||
elif args.quick: s1 += ["--days", "1"]
|
||||
run("step1_collect_messages.py", s1)
|
||||
failures += 1 if run("step1_collect_messages.py", s1) else 0
|
||||
|
||||
s2 = [] if args.full else ["--incremental"]
|
||||
run("step2_extract_links.py", s2)
|
||||
failures += 1 if run("step2_extract_links.py", s2) else 0
|
||||
|
||||
s3 = [] if args.full else ["--incremental"]
|
||||
run("step3_fetch_feishu_docs.py", s3)
|
||||
failures += 1 if run("step3_fetch_feishu_docs.py", s3) else 0
|
||||
|
||||
if not args.skip_download:
|
||||
s4 = [] if args.full else ["--incremental"]
|
||||
run("step4_download_files.py", s4)
|
||||
failures += 1 if run("step4_download_files.py", s4) else 0
|
||||
|
||||
s5 = []
|
||||
if args.quick: s5 += ["--since", "today", "--brief"]
|
||||
elif args.since: s5 += ["--since", args.since]
|
||||
elif args.days: s5 += ["--days", str(args.days)]
|
||||
run("step5_generate_summary.py", s5)
|
||||
failures += 1 if run("step5_generate_summary.py", s5) else 0
|
||||
|
||||
if not args.skip_kb:
|
||||
run("step6_update_knowledge_base.py")
|
||||
failures += 1 if run("step6_update_knowledge_base.py") else 0
|
||||
|
||||
print(f"\n{'='*50}\n 全部完成! ({time.time()-t0:.1f}s)\n{'='*50}")
|
||||
status = "全部完成" if failures == 0 else f"完成,但有 {failures} 步失败"
|
||||
print(f"\n{'='*50}\n {status}! ({time.time()-t0:.1f}s)\n{'='*50}")
|
||||
return 1 if failures else 0
|
||||
|
||||
if __name__ == "__main__": main()
|
||||
if __name__ == "__main__": sys.exit(main())
|
||||
|
||||
Reference in New Issue
Block a user