Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/profiles/server.py
diff options
context:
space:
mode:
authorDaniel Girtler <blackrabbit256@gmail.com>2022-05-09 20:02:48 +1000
committerGitHub <noreply@github.com>2022-05-09 12:02:48 +0200
commit0fa52a5424e28ed62ef84bdc92868bbfc434e015 (patch)
tree4b88e7799319aa9489f7e16beedf5517b6feba34 /profiles/server.py
parent20ffebac50478554a7582de5e5c1d8b4504ea8be (diff)
Introduce ctrl+c and other bug fixes (#1152)
* Intergrate ctrl+c * stash * Update * Fix profile reset * flake8 Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
Diffstat (limited to 'profiles/server.py')
-rw-r--r--profiles/server.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/profiles/server.py b/profiles/server.py
index 91ac7cf2..21681c2f 100644
--- a/profiles/server.py
+++ b/profiles/server.py
@@ -1,8 +1,14 @@
# Used to select various server application profiles on top of a minimal installation.
import logging
+from typing import Any, TYPE_CHECKING
import archinstall
+from archinstall import Menu
+from archinstall.lib.menu.menu import MenuSelectionType
+
+if TYPE_CHECKING:
+ _: Any
is_top_level_profile = True
@@ -26,15 +32,18 @@ def _prep_function(*args, **kwargs):
Magic function called by the importing installer
before continuing any further.
"""
- servers = archinstall.Menu(str(_(
+ choice = Menu(str(_(
'Choose which servers to install, if none then a minimal installation wil be done')),
available_servers,
- preset_values=archinstall.storage.get('_selected_servers', []),
+ preset_values=kwargs['servers'],
multi=True
).run()
- if servers:
- archinstall.storage['_selected_servers'] = servers
+ if choice.type_ != MenuSelectionType.Selection:
+ return False
+
+ if choice.value:
+ archinstall.storage['_selected_servers'] = choice.value
return True
return False