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
2 changes: 1 addition & 1 deletion archinstall/lib/disk/disk_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def _prev_disk_encryption(self, item: MenuItem) -> str | None:

if enc_config:
enc_type = enc_config.encryption_type
output = tr('Encryption type') + f': {EncryptionType.type_to_text(enc_type)}\n'
output = tr('Encryption type') + f': {enc_type.type_to_text()}\n'

if enc_config.encryption_password:
output += tr('Password') + f': {enc_config.encryption_password.hidden()}\n'
Expand Down
6 changes: 3 additions & 3 deletions archinstall/lib/disk/encryption_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def _prev_type(self) -> str | None:
enc_type = self._item_group.find_by_key('encryption_type').value

if enc_type:
enc_text = EncryptionType.type_to_text(enc_type)
enc_text = enc_type.type_to_text()
return f'{tr("Encryption type")}: {enc_text}'

return None
Expand Down Expand Up @@ -252,9 +252,9 @@ def select_encryption_type(
if not preset:
preset = options[0]

preset_value = EncryptionType.type_to_text(preset)
preset_value = preset.type_to_text()

items = [MenuItem(EncryptionType.type_to_text(o), value=o) for o in options]
items = [MenuItem(o.type_to_text(), value=o) for o in options]
group = MenuItemGroup(items)
group.set_focus_by_value(preset_value)

Expand Down
4 changes: 2 additions & 2 deletions archinstall/lib/global_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from archinstall.lib.disk.disk_menu import DiskLayoutConfigurationMenu
from archinstall.lib.models.application import ApplicationConfiguration, ZramConfiguration
from archinstall.lib.models.authentication import AuthenticationConfiguration
from archinstall.lib.models.device import DiskLayoutConfiguration, DiskLayoutType, EncryptionType, FilesystemType, PartitionModification
from archinstall.lib.models.device import DiskLayoutConfiguration, DiskLayoutType, FilesystemType, PartitionModification
from archinstall.lib.packages import list_available_packages
from archinstall.tui.menu_item import MenuItem, MenuItemGroup

Expand Down Expand Up @@ -375,7 +375,7 @@ def _prev_disk_config(self, item: MenuItem) -> str | None:
output += '{}: {}'.format(tr('LVM configuration type'), disk_layout_conf.lvm_config.config_type.display_msg()) + '\n'

if disk_layout_conf.disk_encryption:
output += tr('Disk encryption') + ': ' + EncryptionType.type_to_text(disk_layout_conf.disk_encryption.encryption_type) + '\n'
output += tr('Disk encryption') + ': ' + disk_layout_conf.disk_encryption.encryption_type.type_to_text() + '\n'

if disk_layout_conf.btrfs_options:
btrfs_options = disk_layout_conf.btrfs_options
Expand Down
9 changes: 4 additions & 5 deletions archinstall/lib/models/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -1444,11 +1444,10 @@ def text_to_type(cls, text: str) -> 'EncryptionType':
mapping = cls._encryption_type_mapper()
return mapping[text]

@classmethod
def type_to_text(cls, type_: 'EncryptionType') -> str:
mapping = cls._encryption_type_mapper()
type_to_text = {type_: text for text, type_ in mapping.items()}
return type_to_text[type_]
def type_to_text(self) -> str:
mapping = self._encryption_type_mapper()
type_to_text = {enctype: text for text, enctype in mapping.items()}
return type_to_text[self]


class _DiskEncryptionSerialization(TypedDict):
Expand Down