def OnLoad(self, event): wildcard = "cbf images (*.cbf)|*.cbf|All Files (*.*)|*.*" dlg = wx.FileDialog( self, message="Select a cbf image", defaultDir=os.getcwd(), wildcard=wildcard, defaultFile="", style=wx.OPEN, ) done = False while not done: try: if dlg.ShowModal() == wx.ID_OK: filename = dlg.GetPath() self.Close(True) launcher.view_experiment(filename) done = True elif dlg.ShowModal() == wx.ID_CANCEL: done = True dlg.Destroy() except IOError: message = "Invalid file. Please choose another." caption = "Error" wx.MessageBox(message, caption, wx.ICON_ERROR)
def OnLoad(self, event): wildcard = "cbf images (*.cbf)|*.cbf|All Files (*.*)|*.*" dlg = wx.FileDialog(self, message = "Select a cbf image", defaultDir = os.getcwd(), wildcard = wildcard, defaultFile = "", style = wx.OPEN) done = False while not done: try: if dlg.ShowModal() == wx.ID_OK: filename = dlg.GetPath() self.Close(True) launcher.view_experiment(filename) done = True elif dlg.ShowModal() == wx.ID_CANCEL: done = True dlg.Destroy() except IOError: message = "Invalid file. Please choose another." caption = "Error" wx.MessageBox(message, caption, wx.ICON_ERROR)
def OnReset(self, event): self.Close(True) launcher.view_experiment(filename)