Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/locale_helpers.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-04-14 11:30:24 +0000
committerGitHub <noreply@github.com>2021-04-14 11:30:24 +0000
commitc9e1d4a8c3435401220c1108ac938971ad517a37 (patch)
tree9c1d23ef2e9c8bb9033fe09b6e3a3c52c24db61a /archinstall/lib/locale_helpers.py
parent82710fe381604fc4db77a2dbe2be8cbae3c61c05 (diff)
parent4e2c3c3dc79857d1d27137f935cb423a5e32c585 (diff)
Merge pull request #304 from advaithm/master
Fixing kbd layout issues and non-logical crashes in guided.py questions
Diffstat (limited to 'archinstall/lib/locale_helpers.py')
-rw-r--r--archinstall/lib/locale_helpers.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/archinstall/lib/locale_helpers.py b/archinstall/lib/locale_helpers.py
index 82964dc9..736bfc47 100644
--- a/archinstall/lib/locale_helpers.py
+++ b/archinstall/lib/locale_helpers.py
@@ -4,27 +4,22 @@ import os
from .exceptions import *
# from .general import sys_command
-def list_keyboard_languages(layout='qwerty'):
+def list_keyboard_languages():
locale_dir = '/usr/share/kbd/keymaps/'
if not os.path.isdir(locale_dir):
raise RequirementError(f'Directory containing locales does not exist: {locale_dir}')
for root, folders, files in os.walk(locale_dir):
- # Since qwerty is under /i386/ but other layouts are
- # in different spots, we'll need to filter the last foldername
- # of the path to verify against the desired layout.
- if os.path.basename(root) != layout:
- continue
for file in files:
if os.path.splitext(file)[1] == '.gz':
yield file.strip('.gz').strip('.map')
-def search_keyboard_layout(filter, layout='qwerty'):
- for language in list_keyboard_languages(layout):
+def search_keyboard_layout(filter):
+ for language in list_keyboard_languages():
if filter.lower() in language.lower():
yield language
def set_keyboard_language(locale):
- return subprocess.call(['loadkeys',locale]) == 0
+ return subprocess.call(['loadkeys', locale]) == 0