How to use the safeeyes.Utility.write_json function in safeeyes

To help you get started, we’ve selected a few safeeyes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github slgobinath / SafeEyes / safeeyes / model.py View on Github external
def save(self):
        """
        Save the configuration to file.
        """
        Utility.write_json(Utility.CONFIG_FILE_PATH, self.__user_config)
github slgobinath / SafeEyes / safeeyes / SafeEyes.py View on Github external
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)
github slgobinath / SafeEyes / safeeyes / SafeEyes.py View on Github external
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'])