- Fixes.
This commit is contained in:
parent
49fc9709d2
commit
a9fa1f0156
@ -21,7 +21,7 @@ class AttackDisplay(wx.ScrolledWindow):
|
||||
|
||||
wx.ScrolledWindow.__init__(self,parent,id=-1)
|
||||
# Wait for the attack to be computed
|
||||
while not attack.pngfile:
|
||||
while not attack.file:
|
||||
time.sleep(1)
|
||||
|
||||
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.SetSizer(self.hbox)
|
||||
|
||||
filename = attack.pngfile
|
||||
filename = attack.file
|
||||
self.original = wx.Image(filename,wx.BITMAP_TYPE_PNG)
|
||||
|
||||
|
||||
|
@ -100,7 +100,8 @@ class AttackThread(threading.Thread):
|
||||
pw.write(attack.scytherDot)
|
||||
pw.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):
|
||||
|
||||
"""
|
||||
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__(
|
||||
self, parent, parentwindow, title, pos=wx.DefaultPosition, size=wx.DefaultSize,
|
||||
style=wx.DEFAULT_DIALOG_STYLE
|
||||
@ -156,14 +165,9 @@ class ResultWindow(wx.Frame):
|
||||
w.Show(True)
|
||||
|
||||
def onCloseWindow(self,evt):
|
||||
# TODO we should kill self.thread
|
||||
""" TODO we should kill self.thread """
|
||||
|
||||
# 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.Destroy()
|
||||
|
Loading…
Reference in New Issue
Block a user