Esempio n. 1
0
    def save_settings(self,
                      component: PanelComponent) -> Tuple[bool, List[str]]:
        config = read_config()

        form_env = component.components[0]

        config['environment']['electron']['version'] = str(
            form_env.get_component('electron_version').get_value()).strip()

        if len(config['environment']['electron']['version']) == 0:
            config['environment']['electron']['version'] = None

        system_nativefier = form_env.get_component('nativefier').get_selected()

        if system_nativefier and not nativefier.is_available():
            return False, [
                self.i18n['web.settings.env.nativefier.system.not_installed'].
                format('Nativefier')
            ]

        config['environment']['system'] = system_nativefier

        try:
            save_config(config, CONFIG_FILE)
            return True, None
        except:
            return False, [traceback.format_exc()]
Esempio n. 2
0
    def save_settings(self, component: PanelComponent) -> Tuple[bool, List[str]]:
        config = read_config()
        config['installation_level'] = component.components[0].components[0].get_selected()

        try:
            save_config(config, CONFIG_FILE)
            return True, None
        except:
            return False, [traceback.format_exc()]
Esempio n. 3
0
    def save_settings(self,
                      component: PanelComponent) -> Tuple[bool, List[str]]:
        config = read_config()

        panel = component.components[0]
        config['db_updater']['enabled'] = panel.get_component(
            'up_enabled').get_selected()
        config['db_updater']['interval'] = panel.get_component(
            'up_int').get_int_value()

        try:
            save_config(config, CONFIG_FILE)
            return True, None
        except:
            return False, [traceback.format_exc()]