コード例 #1
0
 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)
コード例 #2
0
ファイル: safeeyes.py プロジェクト: michaelskyf/SafeEyes
 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'])