-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathcleanup.py
More file actions
executable file
·26 lines (22 loc) · 871 Bytes
/
cleanup.py
File metadata and controls
executable file
·26 lines (22 loc) · 871 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/python3
import os
def delFolder(folder):
for root, dirs, files in os.walk(folder, topdown=False):
for f in files:
fabs = os.path.join(root, f)
print ("rm " + fabs)
for f in dirs:
fabs = os.path.join(root, f)
print ("rmdir " + fabs)
if __name__ == '__main__':
standardmesh = "hm08"
startpath = os.path.dirname(os.path.abspath(__file__))
data = os.path.join(startpath, "data")
for elem in ["clothes", "eyes", "tongue", "skins", "eyelashes", "eyebrows", "teeth", "proxy"]:
check = os.path.join(data, elem, standardmesh)
files = os.listdir(check)
for subelem in files:
ftest = os.path.join(check, subelem)
if subelem != "icons" and os.path.isdir(ftest):
delFolder(ftest)
print ("rmdir " + ftest)