-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclear.py
More file actions
30 lines (29 loc) · 964 Bytes
/
clear.py
File metadata and controls
30 lines (29 loc) · 964 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
import shutil
from os import path, sys, remove
from glob import glob
if __name__ == '__main__':
self_dir = path.dirname(__file__)
for dir in ['build', 'dist', 'PyPnPObjects.egg-info']:
shutil.rmtree(
path.abspath(
path.join(
self_dir,
dir
)
),
ignore_errors=True,
onerror= lambda func, _path, exception : sys.stdout.write('{0} could not be deleted : {1}\n'.format(_path, exception))
)
shutil.rmtree(
path.abspath(
path.join(
self_dir,
'pypnpobjects',
'__pycache__'
)
),
ignore_errors=True,
onerror= lambda func, _path, exception : sys.stdout.write('{0} could not be deleted : {1}\n'.format(_path, exception))
)
for f in glob(path.abspath(path.join(self_dir, 'pypnpobjects', '*.pyc'))):
remove(f)