pyanaconda.modules.localization.localization_interface

Classes

KeyboardConfigurationTaskInterface

Interface to get keyboard configuration data.

LocalizationInterface

DBus interface for Localization module.

Module Contents

class pyanaconda.modules.localization.localization_interface.KeyboardConfigurationTaskInterface[source]

Bases: pyanaconda.modules.common.task.TaskInterface

Interface to get keyboard configuration data.

static convert_result(value)[source]

Convert value to publishable result.

From: ((“us”, “cs (qwerty)”), “cs-qwerty”)

class pyanaconda.modules.localization.localization_interface.LocalizationInterface[source]

Bases: pyanaconda.modules.common.base.KickstartModuleInterface

DBus interface for Localization module.

connect_signals()[source]

Connect the signals.

GetLanguages()[source]

Get languages with available translations.

For example: [“en”, “cs”]

Returns:

a list of language ids

Return type:

List[Str]

GetLanguageData(language_id)[source]

Get data about the specified language.

Param:

a language id (for example, “en”)

Returns:

a language data

Parameters:

language_id (Str)

Return type:

Structure

GetLocales(language_id)[source]

Get locales available for the specified language.

For example: [“de_DE.UTF-8”, “de_AT.UTF-8”, … ]

Returns:

a list of locale ids

Parameters:

language_id (Str)

Return type:

List[Str]

GetCommonLocales()[source]

Get a list of the most commonly used locales.

For example: [“ar_EG.UTF-8”, “en_US.UTF-8”, “en_GB.UTF-8”, …]

Returns:

a list of common locale IDs

Return type:

List[Str]

GetLocaleData(locale_id)[source]

Get data about the specified locale.

Param:

a locale id (for example, “en_US.UTF-8”)

Returns:

a locale data

Parameters:

locale_id (Str)

Return type:

Structure

GetKeyboardLayouts()[source]

Get keyboard layouts.

Returns a list of all available keyboard layouts. Each layout is represented as a KeyboardLayout structure.

Returns:

List of KeyboardLayout structures

Return type:

List[Structure]

property Language: Str[source]

The language the system will use.

Return type:

Str

property LanguageSupport: List[Str][source]

Supported languages on the system.

Return type:

List[Str]

property LanguageKickstarted: Bool[source]

Was the language set in a kickstart?

Returns:

True if it was set in a kickstart, otherwise False

Return type:

Bool

SetKeyboard(keyboard)[source]

Set the system keyboard type in generic way.

Can contain virtual console keyboard mapping or X layout specification. This is deprecated way of specifying keyboard, use either SetVirtualConsoleKeymap and/or SetXLayouts.

Parameters:

keyboard (Str) – system keyboard specification

property VirtualConsoleKeymap: Str[source]

Virtual Console keyboard mapping.

Return type:

Str

property XLayouts: List[Str][source]

X Layouts that should be used on the system.

Return type:

List[Str]

property LayoutSwitchOptions: List[Str][source]

List of options for layout switching

Return type:

List[Str]

property KeyboardKickstarted: Bool[source]

Was keyboard command seen in kickstart?

Returns:

True if keyboard command was seen in kickstart, otherwise False

Return type:

Bool

PopulateMissingKeyboardConfigurationWithTask()[source]

Pouplate missing keyboard configuration.

The configuration is populated by conversion and/or default values.

Returns:

DBus path of the task populating the configuration

Return type:

ObjPath

GetKeyboardConfigurationWithTask()[source]

Get current keyboard configuration without storing it into module.

This task will give you a potential configuration to be installed at the time of task execution. The task is read only, the results are not used anywhere by the localization module.

Return type:

ObjPath

ApplyKeyboardWithTask()[source]

Apply keyboard configuration to the current system.

Returns:

DBus path of the task applying the configuration

Return type:

ObjPath

GetCompositorSelectedLayout()[source]

Get the activated keyboard layout.

Returns:

Current keyboard layout (e.g. “cz (qwerty)”)

Return type:

str

SetCompositorSelectedLayout(layout_variant)[source]

Set the activated keyboard layout.

Parameters:

layout_variant (str) – The layout to set, with format “layout (variant)” (e.g. “cz (qwerty)”)

Returns:

If the keyboard layout was activated

Return type:

bool

SelectNextCompositorLayout()[source]

Set the next available layout as active.

CompositorSelectedLayoutChanged(layout)[source]

Signal emitted when the selected keyboard layout changes.

Parameters:

layout (Str)

GetCompositorLayouts()[source]

Get all available keyboard layouts.

Returns:

A list of keyboard layouts (e.g. [“cz (qwerty)”, cn (mon_todo_galik)])

Return type:

list of strings

SetCompositorLayouts(layout_variants, options)[source]

Set the available keyboard layouts.

Parameters:
  • layout_variants (list of strings) – A list of keyboard layouts (e.g. [“cz (qwerty)”, cn (mon_todo_galik)])

  • options (list of strings) – A list of switching options

SetXKeyboardDefaults()[source]

Set default keyboard settings based on the selected language.

This method sets sensible default keyboard layouts based on the currently selected language using langtable data. It will populate XLayouts with appropriate layouts for the language, including ASCII support when needed.

CompositorLayoutsChanged(layouts)[source]

Signal emitted when available layouts change.

Parameters:

layouts (List[Str])