MCPcopy Index your code
hub / github.com/archlinux/archinstall / do_on_select

Method do_on_select

archinstall/default_profiles/server.py:24–53  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

22
23 @override
24 async def do_on_select(self) -> SelectResult:
25 items = [
26 MenuItem(
27 p.name,
28 value=p,
29 preview_action=lambda x: x.value.preview_text() if x.value else None,
30 )
31 for p in profile_handler.get_server_profiles()
32 ]
33
34 group = MenuItemGroup(items, sort_items=True)
35 group.set_selected_by_value(self.current_selection)
36
37 result = await Selection[Self](
38 group,
39 allow_reset=True,
40 allow_skip=True,
41 multi=True,
42 preview_location='right',
43 ).show()
44
45 match result.type_:
46 case ResultType.Selection:
47 selections = result.get_values()
48 self.current_selection = selections
49 return SelectResult.NewSelection
50 case ResultType.Skip:
51 return SelectResult.SameSelection
52 case ResultType.Reset:
53 return SelectResult.ResetCurrent
54
55 @override
56 def provision(self, install_session: Installer, users: list[User]) -> None:

Callers

nothing calls this directly

Calls 7

set_selected_by_valueMethod · 0.95
MenuItemClass · 0.90
MenuItemGroupClass · 0.90
preview_textMethod · 0.80
get_server_profilesMethod · 0.80
get_valuesMethod · 0.80
showMethod · 0.45

Tested by

no test coverage detected