forked from jrontynen/kspect-2d-square
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck.py
40 lines (25 loc) · 872 Bytes
/
check.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
import os
import re
#For natural sorting:
def atoi(text):
return int(text) if text.isdigit() else text
def natural_keys(text):
'''
alist.sort(key=natural_keys) sorts in human order
http://nedbatchelder.com/blog/200712/human_sorting.html
(See Toothy's implementation in the comments)
'''
return [ atoi(c) for c in re.split('(\d+)', text) ]
res = []
for fname in os.listdir("./out"):
if fname[:6] == 'jobe1-':
if 'SUCCESS' not in open('./out/' + fname).read():
res.append(fname + " no success")
#if 'matlab: command' in open('./out/' + fname).read():
# res.append(fname + ": command not found")
#if 'memory limit' in open('./out/' + fname).read():
# res.append(fname[4:10] + ",")
if len(res) > 0:
res.sort(key=natural_keys)
print "\n".join(res)
#print res