Commit 5c6dfda0 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Minor improvements.

parent 7de60932
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -47,10 +47,12 @@ for row in fileList:
            basePaths.append(basePath)

for basePath in basePaths:
    for root, dir, files in os.walk(basePath, topdown = False):
        if root != basePath and not os.listdir(root):
            os.rmdir(root)
            print(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + ' ' + root)
    for root, dirs, files in os.walk(basePath, topdown = False):
        for dir in dirs:
            dirPath = os.path.abspath(root) + '/' + dir
            if not os.listdir(dirPath):
                os.rmdir(dirPath)
                print(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + ' ' + dirPath)

# 1) delete files and update the db
# 2) check for empty dirs and delete them if different from rootPath