Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib
diff options
context:
space:
mode:
authorDaniel Girtler <blackrabbit256@gmail.com>2022-05-17 19:11:45 +1000
committerGitHub <noreply@github.com>2022-05-17 11:11:45 +0200
commit72a44e34ef7f4f73126e4d33adc102e6b66fac43 (patch)
tree46a382e9403f1eda54105fcaf6e0d73d51293611 /archinstall/lib
parent47928b0bcc5919a7425c863e66acf64ea1a2b648 (diff)
Fix #1162 (#1204)
Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
Diffstat (limited to 'archinstall/lib')
-rw-r--r--archinstall/lib/disk/blockdevice.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/archinstall/lib/disk/blockdevice.py b/archinstall/lib/disk/blockdevice.py
index 188927b1..4978f19c 100644
--- a/archinstall/lib/disk/blockdevice.py
+++ b/archinstall/lib/disk/blockdevice.py
@@ -3,6 +3,7 @@ import os
import json
import logging
import time
+from functools import cached_property
from typing import Optional, Dict, Any, Iterator, Tuple, List, TYPE_CHECKING
# https://stackoverflow.com/a/39757388/929999
if TYPE_CHECKING:
@@ -32,6 +33,10 @@ class BlockDevice:
# I'm placing the encryption password on a BlockDevice level.
def __repr__(self, *args :str, **kwargs :str) -> str:
+ return self._str_repr
+
+ @cached_property
+ def _str_repr(self) -> str:
return f"BlockDevice({self.device_or_backfile}, size={self._safe_size}GB, free_space={self._safe_free_space}, bus_type={self.bus_type})"
def __iter__(self) -> Iterator[Partition]: