How to use the safeeyes.Utility.load_plugins_config 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 / settings.py View on Github external
def __initialize(self, config):
        # Don't show infobar for changes made internally
        self.infobar_long_break_shown = True
        for short_break in config.get('short_breaks'):
            self.__create_break_item(short_break, True)
        for long_break in config.get('long_breaks'):
            self.__create_break_item(long_break, False)

        for plugin_config in Utility.load_plugins_config(config):
            self.box_plugins.pack_start(self.__create_plugin_item(plugin_config), False, False, 0)
            
        self.spin_short_break_duration.set_value(config.get('short_break_duration'))
        self.spin_long_break_duration.set_value(config.get('long_break_duration'))
        self.spin_short_break_interval.set_value(config.get('short_break_interval'))
        self.spin_long_break_interval.set_value(config.get('long_break_interval'))
        self.spin_time_to_prepare.set_value(config.get('pre_break_warning_time'))
        self.spin_postpone_duration.set_value(config.get('postpone_duration'))
        self.spin_disable_keyboard_shortcut.set_value(config.get('shortcut_disable_time'))
        self.switch_strict_break.set_active(config.get('strict_break'))
        self.switch_postpone.set_active(config.get('allow_postpone'))
        self.switch_persist.set_active(config.get('persist_state'))
        self.switch_rpc_server.set_active(config.get('use_rpc_server'))
        self.infobar_long_break_shown = False