- Added errorcount to Scyther object.

This commit is contained in:
ccremers 2006-08-06 21:16:14 +00:00
parent 756e69bd4f
commit 5d02e446c9

View File

@ -38,6 +38,7 @@ class Scyther(object):
self.inputfile = None self.inputfile = None
self.claims = None self.claims = None
self.errors = None self.errors = None
self.errorcount = 0
def setInput(self,spdl): def setInput(self,spdl):
self.spdl = spdl self.spdl = spdl
@ -69,13 +70,18 @@ class Scyther(object):
# the XML at certain points...) # the XML at certain points...)
xmlinput = stdout.read() xmlinput = stdout.read()
self.errors = stderr.readlines() self.errors = stderr.readlines()
# filter out any non-errors (say maybe only claim etc) and count
# them.
# TODO for now this simply counts the lines
self.errorcount = len(self.errors)
# close # close
stdout.close() stdout.close()
stderr.close() stderr.close()
# Report any errors (if there are some) # Report any errors (if there are some)
if len(self.errors) > 0: if self.errorcount > 0:
print self.errors print self.errors
if len(xmlinput) > 0: if len(xmlinput) > 0: