- Huge improvement in error output.

This commit is contained in:
ccremers 2006-08-07 11:02:14 +00:00
parent 3178e8e90c
commit 7bae7875a0
3 changed files with 17 additions and 5 deletions

View File

@ -72,13 +72,16 @@ class Scyther(object):
# from the error output (maybe this can also be done by flushing
# the XML at certain points...)
xmlinput = stdout.read()
self.errors = stderr.readlines()
errlines = stderr.readlines()
# filter out any non-errors (say maybe only claim etc) and count
# them.
# TODO for now this simply counts the lines
self.errors = []
for l in errlines:
if not l.startswith("claim\t"):
self.errors.append(l.strip())
self.errorcount = len(self.errors)
print self.errorcount
# close
stdout.close()

View File

@ -181,7 +181,7 @@ class ErrorWindow(wx.Dialog):
line = wx.StaticLine(self, -1, size=(20,-1), style=wx.LI_HORIZONTAL)
sizer.Add(line, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.RIGHT|wx.TOP, 5)
label = wx.StaticText(self, -1, "".join(errors))
label = wx.StaticText(self, -1, "\n".join(errors))
sizer.Add(label, 0, wx.ALIGN_LEFT|wx.ALL, 5)
sizer.Add(line, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.RIGHT|wx.TOP, 5)

View File

@ -4,6 +4,7 @@
""" Import externals """
import wx
import sys
#---------------------------------------------------------------------------
@ -63,7 +64,15 @@ class ScytherApp(wx.App):
splash.Show()
""" Build up """
self.mainWindow = Mainwindow.MainWindow('scythergui-default.spdl')
infile = ''
args = sys.argv[1:]
if len(args) > 0:
if args[0] == 'test':
infile = 'scythergui-default.spdl'
else:
infile = args[0]
self.mainWindow = Mainwindow.MainWindow(infile)
self.SetTopWindow(self.mainWindow)
self.mainWindow.Show()