Loading transfer_service/cleaner.py +4 −8 Original line number Diff line number Diff line Loading @@ -46,15 +46,11 @@ for row in fileList: if basePath not in basePaths: basePaths.append(basePath) dirList = [] for basePath in basePaths: for root, dir, files in os.walk(basePath, topdown = False): if root != basePath and not os.listdir(root): dirList.append(root) os.rmdir(root) print(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + ' ' + root) for dir in dirList: os.rmdir(dir) print(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + ' ' + dir) # 1) delete files # 2) check for empty dirs and delete them if different from rootPath (second step), then update the db # 1) delete files and update the db # 2) check for empty dirs and delete them if different from rootPath Loading
transfer_service/cleaner.py +4 −8 Original line number Diff line number Diff line Loading @@ -46,15 +46,11 @@ for row in fileList: if basePath not in basePaths: basePaths.append(basePath) dirList = [] for basePath in basePaths: for root, dir, files in os.walk(basePath, topdown = False): if root != basePath and not os.listdir(root): dirList.append(root) os.rmdir(root) print(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + ' ' + root) for dir in dirList: os.rmdir(dir) print(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + ' ' + dir) # 1) delete files # 2) check for empty dirs and delete them if different from rootPath (second step), then update the db # 1) delete files and update the db # 2) check for empty dirs and delete them if different from rootPath