Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions archinstall/default_profiles/desktops/hyprland.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def services(self) -> list[str]:
return [pref]
return []

def _ask_seat_access(self) -> None:
def _select_seat_access(self) -> None:
# need to activate seat service and add to seat group
header = tr('Hyprland needs access to your seat (collection of hardware devices i.e. keyboard, mouse, etc)')
header += '\n' + tr('Choose an option to give Hyprland access to your hardware') + '\n'
Expand All @@ -67,4 +67,4 @@ def _ask_seat_access(self) -> None:

@override
def do_on_select(self) -> None:
self._ask_seat_access()
self._select_seat_access()
4 changes: 2 additions & 2 deletions archinstall/default_profiles/desktops/labwc.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def services(self) -> list[str]:
return [pref]
return []

def _ask_seat_access(self) -> None:
def _select_seat_access(self) -> None:
# need to activate seat service and add to seat group
header = tr('labwc needs access to your seat (collection of hardware devices i.e. keyboard, mouse, etc)')
header += '\n' + tr('Choose an option to give labwc access to your hardware') + '\n'
Expand All @@ -64,4 +64,4 @@ def _ask_seat_access(self) -> None:

@override
def do_on_select(self) -> None:
self._ask_seat_access()
self._select_seat_access()
4 changes: 2 additions & 2 deletions archinstall/default_profiles/desktops/niri.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def services(self) -> list[str]:
return [pref]
return []

def _ask_seat_access(self) -> None:
def _select_seat_access(self) -> None:
# need to activate seat service and add to seat group
header = tr('niri needs access to your seat (collection of hardware devices i.e. keyboard, mouse, etc)')
header += '\n' + tr('Choose an option to give niri access to your hardware') + '\n'
Expand All @@ -72,4 +72,4 @@ def _ask_seat_access(self) -> None:

@override
def do_on_select(self) -> None:
self._ask_seat_access()
self._select_seat_access()
4 changes: 2 additions & 2 deletions archinstall/default_profiles/desktops/sway.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def services(self) -> list[str]:
return [pref]
return []

def _ask_seat_access(self) -> None:
def _select_seat_access(self) -> None:
# need to activate seat service and add to seat group
header = tr('Sway needs access to your seat (collection of hardware devices i.e. keyboard, mouse, etc)')
header += '\n' + tr('Choose an option to give Sway access to your hardware') + '\n'
Expand All @@ -74,4 +74,4 @@ def _ask_seat_access(self) -> None:

@override
def do_on_select(self) -> None:
self._ask_seat_access()
self._select_seat_access()
4 changes: 2 additions & 2 deletions archinstall/lib/authentication/authentication_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from archinstall.lib.models.users import Password, User
from archinstall.lib.output import FormattedOutput
from archinstall.lib.translationhandler import tr
from archinstall.lib.user.user_menu import ask_for_additional_users
from archinstall.lib.user.user_menu import select_users
from archinstall.lib.utils.util import get_password
from archinstall.tui.ui.menu_item import MenuItem, MenuItemGroup
from archinstall.tui.ui.result import ResultType
Expand Down Expand Up @@ -58,7 +58,7 @@ def _define_menu_options(self) -> list[MenuItem]:

def _create_user_account(self, preset: list[User] | None = None) -> list[User]:
preset = [] if preset is None else preset
users = ask_for_additional_users(preset=preset)
users = select_users(preset=preset)
return users

def _prev_users(self, item: MenuItem) -> str | None:
Expand Down
4 changes: 2 additions & 2 deletions archinstall/lib/bootloader/bootloader_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def run(self) -> BootloaderConfiguration:
return self._bootloader_conf

def _select_bootloader(self, preset: Bootloader | None) -> Bootloader | None:
bootloader = ask_for_bootloader(preset)
bootloader = select_bootloader(preset)

if bootloader:
# Update UKI option based on bootloader
Expand Down Expand Up @@ -177,7 +177,7 @@ def _select_removable(self, preset: bool) -> bool:
raise ValueError('Unhandled result type')


def ask_for_bootloader(preset: Bootloader | None) -> Bootloader | None:
def select_bootloader(preset: Bootloader | None) -> Bootloader | None:
options = []
hidden_options = []
default = None
Expand Down
4 changes: 2 additions & 2 deletions archinstall/lib/disk/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from archinstall.lib.translationhandler import tr

from ..interactions.general_conf import ask_abort
from ..interactions.general_conf import confirm_abort
from ..luks import Luks2
from ..models.device import (
DiskEncryption,
Expand Down Expand Up @@ -335,6 +335,6 @@ def _final_warning(self) -> bool:
print(c, end='', flush=True)
time.sleep(0.25)
except KeyboardInterrupt:
ask_abort()
confirm_abort()

return True
24 changes: 12 additions & 12 deletions archinstall/lib/global_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from archinstall.lib.models.application import ApplicationConfiguration, ZramConfiguration
from archinstall.lib.models.authentication import AuthenticationConfiguration
from archinstall.lib.models.device import DiskLayoutConfiguration, DiskLayoutType, FilesystemType, PartitionModification
from archinstall.lib.network.network_menu import ask_to_configure_network
from archinstall.lib.packages.packages import ask_additional_packages_to_install, list_available_packages
from archinstall.lib.network.network_menu import select_network
from archinstall.lib.packages.packages import list_available_packages, select_additional_packages
from archinstall.tui.ui.menu_item import MenuItem, MenuItemGroup

from .applications.application_menu import ApplicationMenu
Expand All @@ -17,11 +17,11 @@
from .hardware import SysInfo
from .interactions.general_conf import (
add_number_of_parallel_downloads,
ask_for_a_timezone,
ask_hostname,
ask_ntp,
select_hostname,
select_ntp,
select_timezone,
)
from .interactions.system_conf import ask_for_swap, select_kernel
from .interactions.system_conf import select_kernel, select_swap
from .locale.locale_menu import LocaleMenu
from .menu.abstract_menu import CONFIG_KEY, AbstractMenu
from .mirrors import MirrorListHandler, MirrorMenu
Expand Down Expand Up @@ -86,7 +86,7 @@ def _get_menu_options(self) -> list[MenuItem]:
MenuItem(
text=tr('Swap'),
value=ZramConfiguration(enabled=True),
action=ask_for_swap,
action=select_swap,
preview_action=self._prev_swap,
key='swap',
),
Expand All @@ -108,7 +108,7 @@ def _get_menu_options(self) -> list[MenuItem]:
MenuItem(
text=tr('Hostname'),
value='archlinux',
action=ask_hostname,
action=select_hostname,
preview_action=self._prev_hostname,
key='hostname',
),
Expand All @@ -133,7 +133,7 @@ def _get_menu_options(self) -> list[MenuItem]:
),
MenuItem(
text=tr('Network configuration'),
action=ask_to_configure_network,
action=select_network,
value={},
preview_action=self._prev_network_config,
key='network_config',
Expand All @@ -154,14 +154,14 @@ def _get_menu_options(self) -> list[MenuItem]:
),
MenuItem(
text=tr('Timezone'),
action=ask_for_a_timezone,
action=select_timezone,
value='UTC',
preview_action=self._prev_tz,
key='timezone',
),
MenuItem(
text=tr('Automatic time sync (NTP)'),
action=ask_ntp,
action=select_ntp,
value=True,
preview_action=self._prev_ntp,
key='ntp',
Expand Down Expand Up @@ -547,7 +547,7 @@ def _select_additional_packages(self, preset: list[str]) -> list[str]:
if config:
repositories = set(config.optional_repositories)

packages = ask_additional_packages_to_install(
packages = select_additional_packages(
preset,
repositories=repositories,
)
Expand Down
16 changes: 8 additions & 8 deletions archinstall/lib/interactions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@
)
from .general_conf import (
add_number_of_parallel_downloads,
ask_for_a_timezone,
ask_hostname,
ask_ntp,
select_archinstall_language,
select_hostname,
select_ntp,
select_timezone,
)
from .system_conf import ask_for_swap, select_driver, select_kernel
from .system_conf import select_driver, select_kernel, select_swap

__all__ = [
'add_number_of_parallel_downloads',
'ask_for_a_timezone',
'ask_for_swap',
'ask_hostname',
'ask_ntp',
'get_default_partition_layout',
'select_archinstall_language',
'select_devices',
'select_disk_config',
'select_driver',
'select_hostname',
'select_kernel',
'select_main_filesystem_format',
'select_ntp',
'select_swap',
'select_timezone',
'suggest_multi_disk_layout',
'suggest_single_disk_layout',
]
10 changes: 5 additions & 5 deletions archinstall/lib/interactions/general_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class PostInstallationAction(Enum):
CHROOT = tr('chroot into installation for post-installation configurations')


def ask_ntp(preset: bool = True) -> bool:
def select_ntp(preset: bool = True) -> bool:
header = tr('Would you like to use automatic time synchronization (NTP) with the default time servers?\n') + '\n'
header += (
tr(
Expand All @@ -42,7 +42,7 @@ def ask_ntp(preset: bool = True) -> bool:
raise ValueError('Unhandled return type')


def ask_hostname(preset: str | None = None) -> str | None:
def select_hostname(preset: str | None = None) -> str | None:
result = Input(
header=tr('Enter a hostname'),
allow_skip=True,
Expand All @@ -61,7 +61,7 @@ def ask_hostname(preset: str | None = None) -> str | None:
raise ValueError('Unhandled result type')


def ask_for_a_timezone(preset: str | None = None) -> str | None:
def select_timezone(preset: str | None = None) -> str | None:
default = 'UTC'
timezones = list_timezones()

Expand Down Expand Up @@ -179,7 +179,7 @@ def validator(s: str) -> str | None:
return downloads


def ask_post_installation(elapsed_time: float | None = None) -> PostInstallationAction:
def select_post_installation(elapsed_time: float | None = None) -> PostInstallationAction:
header = 'Installation completed'
if elapsed_time is not None:
minutes = int(elapsed_time // 60)
Expand All @@ -203,7 +203,7 @@ def ask_post_installation(elapsed_time: float | None = None) -> PostInstallation
raise ValueError('Post installation action not handled')


def ask_abort() -> None:
def confirm_abort() -> None:
prompt = tr('Do you really want to abort?') + '\n'

result = Confirmation(
Expand Down
4 changes: 2 additions & 2 deletions archinstall/lib/interactions/system_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def select_kernel(preset: list[str] = []) -> list[str]:
return result.get_values()


def ask_for_uki(preset: bool = True) -> bool:
def select_uki(preset: bool = True) -> bool:
prompt = tr('Would you like to use unified kernel images?') + '\n'

result = Confirmation(header=prompt, allow_skip=True, preset=preset).show()
Expand Down Expand Up @@ -108,7 +108,7 @@ def select_driver(options: list[GfxDriver] = [], preset: GfxDriver | None = None
return result.get_value()


def ask_for_swap(preset: ZramConfiguration = ZramConfiguration(enabled=True)) -> ZramConfiguration:
def select_swap(preset: ZramConfiguration = ZramConfiguration(enabled=True)) -> ZramConfiguration:
prompt = tr('Would you like to use swap on zram?') + '\n'

group = MenuItemGroup.yes_no()
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/network/network_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def _edit_iface(self, edit_nic: Nic) -> Nic:
return Nic(iface=iface_name)


def ask_to_configure_network(preset: NetworkConfiguration | None) -> NetworkConfiguration | None:
def select_network(preset: NetworkConfiguration | None) -> NetworkConfiguration | None:
"""
Configure the network on the newly installed system
"""
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/packages/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def _parse_package_output[PackageType: (AvailablePackage, LocalPackage)](
return cls.model_validate(package)


def ask_additional_packages_to_install(
def select_additional_packages(
preset: list[str] = [],
repositories: set[Repository] = set(),
) -> list[str]:
Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/user/user_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def _add_user(self) -> User | None:
return User(username, password, sudo)


def ask_for_additional_users(prompt: str = '', preset: list[User] = []) -> list[User]:
def select_users(prompt: str = '', preset: list[User] = []) -> list[User]:
users = UserList(prompt, preset).show()

if users is None:
Expand Down
14 changes: 4 additions & 10 deletions archinstall/scripts/guided.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from archinstall.lib.global_menu import GlobalMenu
from archinstall.lib.hardware import SysInfo
from archinstall.lib.installer import Installer, accessibility_tools_in_use, run_custom_user_commands
from archinstall.lib.interactions.general_conf import PostInstallationAction, ask_post_installation
from archinstall.lib.interactions.general_conf import PostInstallationAction, select_post_installation
from archinstall.lib.mirrors import MirrorListHandler
from archinstall.lib.models import Bootloader
from archinstall.lib.models.device import (
Expand All @@ -26,13 +26,7 @@
from archinstall.lib.translationhandler import tr


def ask_user_questions(mirror_list_handler: MirrorListHandler) -> None:
"""
First, we'll ask the user for a bunch of user input.
Not until we're satisfied with what we want to install
will we continue with the actual installation steps.
"""

def show_menu(mirror_list_handler: MirrorListHandler) -> None:
upgrade = check_version_upgrade()
title_text = 'Archlinux'

Expand Down Expand Up @@ -176,7 +170,7 @@ def perform_installation(

if not arch_config_handler.args.silent:
elapsed_time = time.time() - start_time
action = ask_post_installation(elapsed_time)
action = select_post_installation(elapsed_time)

match action:
case PostInstallationAction.EXIT:
Expand All @@ -197,7 +191,7 @@ def main() -> None:
)

if not arch_config_handler.args.silent:
ask_user_questions(mirror_list_handler)
show_menu(mirror_list_handler)

config = ConfigurationOutput(arch_config_handler.config)
config.write_debug()
Expand Down
4 changes: 2 additions & 2 deletions archinstall/scripts/only_hd.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from archinstall.lib.output import debug, error


def ask_user_questions() -> None:
def show_menu() -> None:
global_menu = GlobalMenu(arch_config_handler.config)
global_menu.disable_all()

Expand Down Expand Up @@ -56,7 +56,7 @@ def perform_installation(mountpoint: Path) -> None:

def main() -> None:
if not arch_config_handler.args.silent:
ask_user_questions()
show_menu()

config = ConfigurationOutput(arch_config_handler.config)
config.write_debug()
Expand Down