-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcleanup.py
53 lines (39 loc) · 1.03 KB
/
cleanup.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#
import os
import glob
import shutil
#remove tmp.log
try:
if os.path.exists('tmp.log'):
os.remove('tmp.log')
except:
pass
#remove database if it exists
if os.path.exists('movie_elements.db'):
os.remove('movie_elements.db')
#remove /pits/logs/ (Don't do this, we need the checkpoint!)
#remove any file that starts with 'movie_elements.db'
files=glob.glob("./movie_elements.db*")
for f in files:
os.remove(f)
#remove any directories in /static/samples, even if they arent' empty
dirs=glob.glob("./static/samples/*/")
for d in dirs:
shutil.rmtree(d)
#remove any jpgs
jpgs=glob.glob("./static/samples/*.jpg")
for jpg in jpgs:
os.remove(jpg)
#remove any .pickle files in /static/samples
pickles=glob.glob("./static/samples/*.pickle")
for p in pickles:
os.remove(p)
pngs=glob.glob("./static/samples/*.png")
for png in pngs:
os.remove(png)
audio=glob.glob("./static/samples/*.mp3")
for f in audio:
os.remove(f)
audio=glob.glob("./static/samples/*.wav")
for f in audio:
os.remove(f)