-
Notifications
You must be signed in to change notification settings - Fork 0
/
EagleCleanup.py
executable file
·35 lines (30 loc) · 1019 Bytes
/
EagleCleanup.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
#!/usr/bin/python
# Cleanup eagle auto generated files
import os, glob
try:
currentdir = os.path.realpath(__file__)
os.chdir(os.path.dirname(currentdir))
deleteditems = []
directories = ["01_EagleDocuments//AirBoard_Shield", "01_EagleDocuments//Base_Shield", "01_EagleDocuments//lib"]
for dir in directories:
if os.path.isdir(dir):
os.chdir(dir)
for file in glob.glob("*.s#*"):
os.remove(file)
deleteditems.append(file)
for file in glob.glob("*.b#*"):
os.remove(file)
deleteditems.append(file)
for file in glob.glob("*.l#*"):
os.remove(file)
deleteditems.append(file)
os.chdir(os.path.dirname(currentdir))
if deleteditems:
print("Deleted files:")
for item in deleteditems:
print(item)
else:
print("Nothing to be done !!")
os.system('pause')
except ValueError:
print ValueError