From de80fdc153763583c081120cc60c8595d9de97d4 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Mon, 28 Mar 2022 16:04:24 +0200 Subject: Fixed an import of not yet loaded module --- archinstall/lib/user_interaction/partitioning_conf.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'archinstall/lib/user_interaction') diff --git a/archinstall/lib/user_interaction/partitioning_conf.py b/archinstall/lib/user_interaction/partitioning_conf.py index ef4ba885..64c23efe 100644 --- a/archinstall/lib/user_interaction/partitioning_conf.py +++ b/archinstall/lib/user_interaction/partitioning_conf.py @@ -2,7 +2,6 @@ from __future__ import annotations from typing import List, Any, Dict, Union, TYPE_CHECKING, Callable -from ..disk import BlockDevice, suggest_single_disk_layout, suggest_multi_disk_layout, valid_parted_position from ..menu import Menu from ..output import log @@ -10,6 +9,7 @@ from ..disk.validators import fs_types from .subvolume_config import SubvolumeList if TYPE_CHECKING: + from ..disk import BlockDevice from ..disk.partition import Partition _: Any @@ -92,8 +92,9 @@ def select_partition(title :str, partitions :List[Partition], multiple :bool = F return None -def get_default_partition_layout(block_devices: Union[BlockDevice, List[BlockDevice]], +def get_default_partition_layout(block_devices: Union['BlockDevice', List['BlockDevice']], advanced_options: bool = False) -> Dict[str, Any]: + from ..disk import suggest_single_disk_layout, suggest_multi_disk_layout if len(block_devices) == 1: return suggest_single_disk_layout(block_devices[0], advanced_options=advanced_options) @@ -112,7 +113,7 @@ def select_individual_blockdevice_usage(block_devices: list) -> Dict[str, Any]: return result -def manage_new_and_existing_partitions(block_device: BlockDevice) -> Dict[str, Any]: +def manage_new_and_existing_partitions(block_device: 'BlockDevice') -> Dict[str, Any]: block_device_struct = {"partitions": [partition.__dump__() for partition in block_device.partitions.values()]} # Test code: [part.__dump__() for part in block_device.partitions.values()] # TODO: Squeeze in BTRFS subvolumes here @@ -155,6 +156,8 @@ def manage_new_and_existing_partitions(block_device: BlockDevice) -> Dict[str, A break if task == new_partition: + from ..disk import valid_parted_position + # if partition_type == 'gpt': # # https://www.gnu.org/software/parted/manual/html_node/mkpart.html # # https://www.gnu.org/software/parted/manual/html_node/mklabel.html @@ -200,6 +203,8 @@ def manage_new_and_existing_partitions(block_device: BlockDevice) -> Dict[str, A fg="red") continue elif task == suggest_partition_layout: + from ..disk import suggest_single_disk_layout + 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() -- cgit v1.2.3-70-g09d2