def OnOpen(self):
     if self.PromptToSave() != wx.ID_CANCEL:
         filename = self.PromptForFile(wx.FD_OPEN)
         if filename is not None:
             def open_action():
                 self.schedule = schedule.Schedule(filename)
             edit.try_flight(open_action, self.GetParent())
 def AddFlight(self, entry):
     def add_action():
         self.FlightsList.AddFlight(entry)
     return edit.try_flight(add_action, self)
 def OnImport(self):
     filename = self.PromptForFile(wx.FD_OPEN)
     if filename is not None:
         def import_action():
             self.schedule.load_file(filename, False)
         edit.try_flight(import_action, ui_context=self.GetParent())