Skip to content

Commit ca52b7e

Browse files
authored
ruff
1 parent 27e8b23 commit ca52b7e

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

archinstall/lib/locale/locale_menu.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,24 +148,25 @@ async def select_kb_layout(preset: str | None = None) -> str | None:
148148
case _:
149149
raise ValueError('Unhandled return type')
150150

151+
151152
async def select_console_font(preset: str | None = None) -> str | None:
152153
fonts = list_console_fonts()
153154

154155
items = [MenuItem(f, value=f) for f in fonts]
155156
group = MenuItemGroup(items, sort_items=False)
156157
group.set_focus_by_value(preset)
157158

158-
result = SelectMenu[str](
159+
result = await Selecton[str](
159160
group,
160-
alignment=Alignment.CENTER,
161-
frame=FrameProperties.min(tr('Console font')),
162-
allow_skip=True,
163-
).run()
161+
header=tr('Console font'),
162+
group=group,
163+
enable_filter=True,
164+
).show()
164165

165166
match result.type_:
166167
case ResultType.Selection:
167168
return result.get_value()
168169
case ResultType.Skip:
169170
return preset
170171
case _:
171-
raise ValueError('Unhandled return type')
172+
raise ValueError('Unhandled return type')

archinstall/lib/locale/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from archinstall.lib.exceptions import ServiceException, SysCallError
33
from archinstall.lib.output import error
44
from archinstall.lib.utils.util import running_from_iso
5-
5+
from archinstall.linux_path import LPath
66

77
def list_keyboard_languages() -> list[str]:
88
return (
@@ -112,7 +112,7 @@ def list_timezones() -> list[str]:
112112

113113
def list_console_fonts() -> list[str]:
114114
fonts: list[str] = []
115-
font_dir = Path('/usr/share/kbd/consolefonts')
115+
font_dir = LPath('/usr/share/kbd/consolefonts')
116116
if font_dir.exists():
117117
for f in font_dir.iterdir():
118118
# do not ask me there are readme files in here

0 commit comments

Comments
 (0)