Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def save(self):
"""
Save the configuration to file.
"""
Utility.write_json(Utility.CONFIG_FILE_PATH, self.__user_config)
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'])