def LoadSessionFile(self): """ LoadSessionFile Loads the session file if it exists. If it does not, creates an instance. """ try: self.session = gEcritSession.LoadFromFile() self.session.RestoreAppState(self) self.SetStatus(0,self._ ( "Session file loaded.")) except Exceptions.NoSessionFile: self.session = gEcritSession()
def SaveSessionFile(self, event): """ SaveSessionFile Reccords the application state and saves it to disk via the session instance. """ try: #testing if a session object exists self.session except AttributeError: self.session = gEcritSession() self.session.RecordAppState(self) self.session.SaveToFile() self.SetStatus(event, self._ ("Session saved."))