Skip to content

Commit

Permalink
Added stuff to handle error messages in log files
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5806 f3b2605a-c512-4ea7-a41b-209d697bcdaa
  • Loading branch information
athomps committed Mar 21, 2011
1 parent 5137794 commit 7265977
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tools/python/pizza/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,9 @@ def read_one(self,*list):

s1 = txt.find(self.firststr,start)
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 self.style == 2:
s1 = txt.find("\n",s1) + 1
Expand All @@ -294,6 +296,9 @@ def read_one(self,*list):
if txt.find("Loop time of",start) == start: # end of file, so exit
eof -= len(txt) - start # reset eof to "Loop"
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
s1 = 0
Expand All @@ -319,7 +324,6 @@ def read_one(self,*list):
word2 = re.findall(pat2,section)
words = word1 + word2
self.data.append(map(float,words))

else:
lines = chunk.split("\n")
for line in lines:
Expand Down

0 comments on commit 7265977

Please sign in to comment.