This commit is contained in:
ccremers 2006-08-04 22:29:51 +00:00
parent 49fc9709d2
commit a9fa1f0156
2 changed files with 13 additions and 9 deletions

View File

@ -21,7 +21,7 @@ class AttackDisplay(wx.ScrolledWindow):
wx.ScrolledWindow.__init__(self,parent,id=-1) wx.ScrolledWindow.__init__(self,parent,id=-1)
# Wait for the attack to be computed # Wait for the attack to be computed
while not attack.pngfile: while not attack.file:
time.sleep(1) time.sleep(1)
self.Bind(wx.EVT_SIZE, self.OnSize) self.Bind(wx.EVT_SIZE, self.OnSize)
@ -32,7 +32,7 @@ class AttackDisplay(wx.ScrolledWindow):
self.hbox.Add(self.box,1,wx.ALIGN_CENTER) self.hbox.Add(self.box,1,wx.ALIGN_CENTER)
self.SetSizer(self.hbox) self.SetSizer(self.hbox)
filename = attack.pngfile filename = attack.file
self.original = wx.Image(filename,wx.BITMAP_TYPE_PNG) self.original = wx.Image(filename,wx.BITMAP_TYPE_PNG)

View File

@ -100,7 +100,8 @@ class AttackThread(threading.Thread):
pw.write(attack.scytherDot) pw.write(attack.scytherDot)
pw.close() pw.close()
pr.close() pr.close()
attack.pngfile = fpname2 # this is where the file name is stored attack.file = fpname2 # this is where the file name is stored
attack.filetype = "png"
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@ -135,6 +136,14 @@ class VerificationWindow(wx.Dialog):
class ResultWindow(wx.Frame): class ResultWindow(wx.Frame):
"""
Displays the claims status and contains buttons to show the actual
attack graphs
TODO: this really should have a statusbar, and maybe a second tab
for any error output.
"""
def __init__( def __init__(
self, parent, parentwindow, title, pos=wx.DefaultPosition, size=wx.DefaultSize, self, parent, parentwindow, title, pos=wx.DefaultPosition, size=wx.DefaultSize,
style=wx.DEFAULT_DIALOG_STYLE style=wx.DEFAULT_DIALOG_STYLE
@ -156,14 +165,9 @@ class ResultWindow(wx.Frame):
w.Show(True) w.Show(True)
def onCloseWindow(self,evt): def onCloseWindow(self,evt):
# TODO we should kill self.thread """ TODO we should kill self.thread """
# Clean up # Clean up
for cl in self.parent.claims:
for attack in cl.attacks:
if attack.pngfile:
os.unlink(attack.pngfile)
attack.pngfile = None
self.parent.claims = None self.parent.claims = None
self.Destroy() self.Destroy()