Skip to content

Commit

Permalink
Adding dbus interface for loading locale keyboards
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkankovsky committed Jan 14, 2025
1 parent a95908e commit 7d20779
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions pyanaconda/modules/localization/localization_interface.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
#
# DBus interface for the localization module.
#
# Copyright (C) 2018 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY expressed or implied, including the implied warranties of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details. You should have received a copy of the
# GNU General Public License along with this program; if not, write to the
# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the
# source code or documentation are not subject to the GNU General Public
# License and may only be used or replicated with the express permission of
# Red Hat, Inc.
#

from dasbus.server.interface import dbus_interface, dbus_signal
from dasbus.server.property import emits_properties_changed
from dasbus.typing import * # pylint: disable=wildcard-import
Expand Down Expand Up @@ -91,6 +71,17 @@ def GetLocaleData(self, locale_id: Str) -> Structure:
locale_data = self.implementation.get_locale_data(locale_id)
return LocaleData.to_structure(locale_data)

def GetLocaleKeyboards(self, locale: Str) -> List[Str]:
"""Get preferred keyboard layouts for the given locale.
For example: ["us", "cz (qwerty)"]
:param locale: locale string
:return: a list of preferred keyboard layouts
:raises InvalidLocaleSpec: if an invalid locale is given
"""
return self.implementation.get_locale_keyboards(locale)

@property
def Language(self) -> Str:
"""The language the system will use."""
Expand Down

0 comments on commit 7d20779

Please sign in to comment.