Commit 7de60932 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Minor improvement.

parent 08b37a4d
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -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