-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclean.py
More file actions
44 lines (37 loc) · 777 Bytes
/
Copy pathclean.py
File metadata and controls
44 lines (37 loc) · 777 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import os
import shutil
from glob import glob
dirs = [
'./.cache',
'./.pytest_cache',
'./build',
'./dist',
'./docs/build',
'./qmeq.egg-info',
'./qmeq/build',
]
for directory, _, _ in os.walk('./'):
if '__pycache__' in directory:
dirs.append(directory)
for dr in dirs:
if os.path.exists(dr):
shutil.rmtree(dr)
else:
pass
dirs = [
'./qmeq/',
'./qmeq/approach/',
'./qmeq/approach/base/',
'./qmeq/approach/elph/',
'./qmeq/builder/',
'./qmeq/specfunc/',
'./qmeq/tests/',
'./qmeq/wrappers/',
]
exts = ['*.o', '*.so', '*.pyd', '*.dll', '*.pyc', '*.c', '*.html']
files = []
for dr in dirs:
for ext in exts:
files += glob(dr+ext)
for f in files:
os.remove(f)