-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathclean.py
37 lines (30 loc) · 902 Bytes
/
clean.py
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
#!/usr/bin/env python
# Gradiant's Biometrics Team <[email protected]>
# Copyright (C) 2019+ Gradiant, Vigo, Spain
import os
import shutil
import glob
def remove(path):
""" param <path> could either be relative or absolute. """
if os.path.isfile(path):
os.remove(path) # remove the file
elif os.path.isdir(path):
shutil.rmtree(path) # remove dir and all contains
else:
print(" - file {} is not a file or dir.".format(path))
def main():
print("Cleaning auto-generated files and folders...")
remove(".mr.developer.cfg")
remove(".installed.cfg")
remove("bin")
remove("develop-eggs")
remove("eggs")
remove("parts")
remove("src")
remove("doc/output")
remove(".cache")
remove("src/test/__pycache__")
for folder in glob.glob('*.egg-info'):
remove(folder)
if __name__ == '__main__':
main()