优化代码

main
roger_home_pc 11 months ago
parent 54979abb85
commit c8b9b8712e
  1. 28
      main.py

@ -6,23 +6,14 @@ from getMd5 import get_file_md5
from db import * from db import *
from time import time as t from time import time as t
# sjry handle_data = [
# disk = "Data_sjry" {'disk': "Data_sjry", 'cate': "sjry", 'path': r"F:\Temp\sjry\2023-11"},
# cate = "sjry" {'disk': "Data_leshe", 'cate': "leshe", 'path': r"F:\Temp\leshe\2023-12"},
# path = r"F:\Temp\sjry\2023-11" {'disk': "Data_hj", 'cate': "hj", 'path': r"F:\Temp\hj\2023-12"},
]
# leshe
disk = "Data_leshe"
cate = "leshe"
path = r"F:\Temp\leshe\2023-12"
# # hj def main_process(disk, cate, path):
# disk = "Data_hj"
# cate = "hj"
# path = r"F:\Temp\hj\2023-12"
def main_process():
_exist_file_list = [] _exist_file_list = []
if disk == "" or cate == "" or path == "": if disk == "" or cate == "" or path == "":
@ -73,6 +64,7 @@ def handle_exist(_exist_file_list):
if __name__ == "__main__": if __name__ == "__main__":
exist_file_list = main_process() for d in handle_data:
handle_exist(exist_file_list) exist_file_list = main_process(d['disk'], d['cate'], d['path'])
remove_empty_folder(path) handle_exist(exist_file_list)
remove_empty_folder(d['path'])

Loading…
Cancel
Save