def persist_session(self): """ Save the session object to the session file. """ if self.config.get('persist_state'): utility.write_json(utility.SESSION_FILE_PATH, self.context['session']) else: utility.delete(utility.SESSION_FILE_PATH)
def update_next_break(self, break_obj, break_time): """ Update the next break to plugins and save the session. """ self.plugins_manager.update_next_break(break_obj, break_time) self._status = _('Next break at %s') % ( utility.format_time(break_time)) if self.config.get('persist_state'): utility.write_json(utility.SESSION_FILE_PATH, self.context['session'])