-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelrun.py
More file actions
executable file
·40 lines (33 loc) · 979 Bytes
/
delrun.py
File metadata and controls
executable file
·40 lines (33 loc) · 979 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
#!/usr/bin/python
import sys
import runsarr
import os
scwd = str(os.getcwd()).split("/")
if scwd[len(scwd)-1]!="runs":
print "You are not in a runs directory"
sys.exit()
narg=len(sys.argv)
if narg < 2:
print "Number of arguments less than 1"
print "USAGE:"
print "$>delrun.py index1 index2 ..."
print "where indexi is the index of the run, which you can find by running listruns.py"
sys.exit()
runs=runsarr.runsarr()
for run in runs:
s_project=run[0]
s_tstamp=run[1]
index=int(run[2])
s_description=run[3]
s_path=run[4]
s_status=run[5]
s_importance=run[6]
if str(index) in sys.argv[1:]:
print "********** DELETED RUN *****************"
print "PROJECT:",s_project
print "TSTAMP:",s_tstamp
print "INDEX:",index
print "DESCRIPTION:", s_description
print "PATH:", s_path
print "***************************************\n"
os.system("rm -r %s"%(s_path))