优化逻辑

main
RogerWork 1 year ago
parent bc4e330ee7
commit 53f3f839e1
  1. 11
      main.py

@ -8,6 +8,8 @@ def main_process():
cate = ""
path = ""
_exist_file_list = []
if disk == "" or cate == "" or path == "":
print("检查参数")
return
@ -18,9 +20,16 @@ def main_process():
print(f"请注意!!!文件的md5({md5})已经存在: {f}")
else:
md5 = get_file_md5(f)
if exist := is_exist(md5):
_exist_file_list.append(f)
print(f"重复文件!!!md5为({md5})的文件已经存在,文件路径:{exist['path']} -> {f}")
continue
insert_data((cate, disk, f, md5))
print(f"文件的md5({md5})成功插入: {f}")
return _exist_file_list
if __name__ == "__main__":
main_process()
exist_file_list = main_process()
for ef in exist_file_list:
print(ef)

Loading…
Cancel
Save