Added stuff to handle error messages in log files
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5806 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -270,6 +270,8 @@ class log:
|
|||||||
|
|
||||||
s1 = txt.find(self.firststr,start)
|
s1 = txt.find(self.firststr,start)
|
||||||
s2 = txt.find("Loop time of",start+1)
|
s2 = txt.find("Loop time of",start+1)
|
||||||
|
if s2 == -1:
|
||||||
|
s2 = txt.find("ERROR",start+1)
|
||||||
|
|
||||||
if s1 >= 0 and s2 >= 0 and s1 < s2: # found s1,s2 with s1 before s2
|
if s1 >= 0 and s2 >= 0 and s1 < s2: # found s1,s2 with s1 before s2
|
||||||
if self.style == 2:
|
if self.style == 2:
|
||||||
@ -294,6 +296,9 @@ class log:
|
|||||||
if txt.find("Loop time of",start) == start: # end of file, so exit
|
if txt.find("Loop time of",start) == start: # end of file, so exit
|
||||||
eof -= len(txt) - start # reset eof to "Loop"
|
eof -= len(txt) - start # reset eof to "Loop"
|
||||||
break
|
break
|
||||||
|
if txt.find("ERROR",start) == start: # end of file, so exit
|
||||||
|
eof -= len(txt) - start # reset eof to "ERROR"
|
||||||
|
break
|
||||||
|
|
||||||
last = 1 # entire read is a chunk
|
last = 1 # entire read is a chunk
|
||||||
s1 = 0
|
s1 = 0
|
||||||
@ -319,7 +324,6 @@ class log:
|
|||||||
word2 = re.findall(pat2,section)
|
word2 = re.findall(pat2,section)
|
||||||
words = word1 + word2
|
words = word1 + word2
|
||||||
self.data.append(map(float,words))
|
self.data.append(map(float,words))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
lines = chunk.split("\n")
|
lines = chunk.split("\n")
|
||||||
for line in lines:
|
for line in lines:
|
||||||
|
|||||||
Reference in New Issue
Block a user