From bcd810d2d20e657d96f36e0007facff71e9532bc Mon Sep 17 00:00:00 2001 From: Daniel Girtler Date: Thu, 5 May 2022 20:48:01 +1000 Subject: Fix 1117 (#1126) * Fix 1117 * Update * flake8 Co-authored-by: Daniel Girtler --- archinstall/lib/user_interaction/partitioning_conf.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'archinstall/lib/user_interaction/partitioning_conf.py') diff --git a/archinstall/lib/user_interaction/partitioning_conf.py b/archinstall/lib/user_interaction/partitioning_conf.py index 2182c6b3..afca1cef 100644 --- a/archinstall/lib/user_interaction/partitioning_conf.py +++ b/archinstall/lib/user_interaction/partitioning_conf.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import List, Any, Dict, Union, TYPE_CHECKING, Callable +from typing import List, Any, Dict, Union, TYPE_CHECKING, Callable, Optional from ..menu import Menu from ..output import log @@ -97,8 +97,10 @@ def select_partition(title :str, partitions :List[Partition], multiple :bool = F return None -def get_default_partition_layout(block_devices: Union['BlockDevice', List['BlockDevice']], - advanced_options: bool = False) -> Dict[str, Any]: +def get_default_partition_layout( + block_devices: Union['BlockDevice', List['BlockDevice']], + advanced_options: bool = False +) -> Optional[Dict[str, Any]]: from ..disk import suggest_single_disk_layout, suggest_multi_disk_layout if len(block_devices) == 1: @@ -224,9 +226,9 @@ def manage_new_and_existing_partitions(block_device: 'BlockDevice') -> Dict[str, if len(block_device_struct["partitions"]): prompt = _('{} contains queued partitions, this will remove those, are you sure?').format(block_device) - choice = Menu(prompt, ['yes', 'no'], default_option='no').run() + choice = Menu(prompt, Menu.yes_no(), default_option=Menu.no()).run() - if choice == 'no': + if choice == Menu.no(): continue block_device_struct.update(suggest_single_disk_layout(block_device)[block_device.path]) -- cgit v1.2.3-54-g00ecf