-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creating a dbus interface to get local keyboard layouts
Adding dbus interface for loading locale keyboards Remove duplicate function and migrate to localization one
- Loading branch information
1 parent
15ff849
commit e590a17
Showing
5 changed files
with
135 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# | ||
# DBus structure for keyboard layout in localization module. | ||
# | ||
# Copyright (C) 2025 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.structure import DBusData | ||
from dasbus.typing import List, Str # Pylint: disable=wildcard-import | ||
|
||
__all__ = ["KeyboardLayout"] | ||
|
||
|
||
class KeyboardLayout(DBusData): | ||
"""Structure representing a keyboard layout.""" | ||
|
||
def __init__(self, layout_id="", description="", langs=""): | ||
self._layout_id = layout_id | ||
self._description = description | ||
self._langs = langs | ||
|
||
@property | ||
def layout_id(self) -> Str: | ||
"""Return the keyboard layout ID.""" | ||
return self._layout_id | ||
|
||
@layout_id.setter | ||
def layout_id(self, value: Str): | ||
self._layout_id = value | ||
|
||
@property | ||
def description(self) -> Str: | ||
"""Return the description of the layout.""" | ||
return self._description | ||
|
||
@description.setter | ||
def description(self, value: Str): | ||
self._description = value | ||
|
||
@property | ||
def langs(self) -> List[Str]: | ||
"""Return the list of associated languages.""" | ||
return self._langs | ||
|
||
@langs.setter | ||
def langs(self, value: List[Str]): | ||
self._langs = value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters