Пример #1
0
 def _assign_generic_keyboard_setting_task_test(
         self, mocked_load_keymap, mocked_conf, can_activate_keyboard,
         keyboard, load_keymap_result, result_x_layouts, result_vc_keymap):
     mocked_conf.system.can_activate_keyboard = can_activate_keyboard
     mocked_load_keymap.return_value = load_keymap_result
     task = AssignGenericKeyboardSettingTask(keyboard=keyboard)
     result = task.run()
     assert result == (result_x_layouts, result_vc_keymap)
Пример #2
0
    def set_from_generic_keyboard_setting(self, keyboard):
        """Set keyboard from generic keyboard setting

        :param keyboard:
        """
        log.debug("Setting keyboard from generic setting value '%s'.",
                  keyboard)
        if self.vc_keymap or self.x_layouts:
            log.debug(
                "Ignoring generic keyboard setting as we have a specific one.")
            return

        task = AssignGenericKeyboardSettingTask(keyboard=keyboard)
        result = task.run()
        self._update_settings_from_task(result)