diff --git a/gui/Gui/Mainwindow.py b/gui/Gui/Mainwindow.py index 82357c9..4b73c87 100644 --- a/gui/Gui/Mainwindow.py +++ b/gui/Gui/Mainwindow.py @@ -34,7 +34,7 @@ class MainWindow(wx.Frame): self.opts = opts self.args = args - self.dirname = '.' + self.dirname = os.path.abspath('.') self.filename = 'noname.spdl' self.load = False @@ -265,7 +265,6 @@ class SettingsWindow(wx.Panel): self.win = daddy - # Bound on the number of runs self.maxruns = int(Preference.get('maxruns','5')) r1 = wx.StaticText(self,-1,"Maximum number of runs (0 disables bound)") diff --git a/gui/Gui/Scytherthread.py b/gui/Gui/Scytherthread.py index 3b2eef6..65895b0 100644 --- a/gui/Gui/Scytherthread.py +++ b/gui/Gui/Scytherthread.py @@ -426,20 +426,23 @@ class ScytherRun(object): self.resultwin = resultwin = ResultWindow(self,mainwin,title) def attackDone(attack,total,done): - if done < total: - txt = "Generating attack graphs (%i of %i done)." % (done,total) - else: - txt = "Done." - resultwin.SetStatusText(txt) - resultwin.Refresh() + if resultwin: + if done < total: + txt = "Generating attack graphs (%i of %i done)." % (done,total) + else: + txt = "Done." + resultwin.SetStatusText(txt) + resultwin.Refresh() def claimDone(claim): - if claim.button and len(claim.attacks) > 0: - claim.button.Enable() - #resultwin.Refresh() + if resultwin: + if claim.button and len(claim.attacks) > 0: + claim.button.Enable() + #resultwin.Refresh() def allDone(): - resultwin.SetCursor(wx.StockCursor(wx.CURSOR_ARROW)) + if resultwin: + resultwin.SetCursor(wx.StockCursor(wx.CURSOR_ARROW)) resultwin.Center() resultwin.Show(True)