index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | profiles/server.py | 28 |
diff --git a/profiles/server.py b/profiles/server.py index c4f35f7b..21681c2f 100644 --- a/profiles/server.py +++ b/profiles/server.py @@ -1,12 +1,18 @@ # 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 -__description__ = 'Provides a selection of various server packages to install and enable, e.g. httpd, nginx, mariadb' +__description__ = str(_('Provides a selection of various server packages to install and enable, e.g. httpd, nginx, mariadb')) available_servers = [ "cockpit", @@ -26,15 +32,21 @@ def _prep_function(*args, **kwargs): Magic function called by the importing installer before continuing any further. """ - if not archinstall.storage.get('_selected_servers', None): - servers = archinstall.Menu( - 'Choose which servers to install, if none then a minimal installation wil be done', available_servers, - multi=True - ).run() + choice = Menu(str(_( + 'Choose which servers to install, if none then a minimal installation wil be done')), + available_servers, + preset_values=kwargs['servers'], + multi=True + ).run() + + if choice.type_ != MenuSelectionType.Selection: + return False - archinstall.storage['_selected_servers'] = servers + if choice.value: + archinstall.storage['_selected_servers'] = choice.value + return True - return True + return False if __name__ == 'server': |