Skip to content
Snippets Groups Projects
Commit 5c6dfda0 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Minor improvements.

parent 7de60932
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment