index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Daniel <blackrabbit256@gmail.com> | 2022-04-22 21:23:38 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-22 13:23:38 +0200 |
commit | 2529d6a5f59eb6a16f95bf9d1117a6033c527df9 (patch) | |
tree | c115a489296404df3f578cc61208c8c8551127b0 /archinstall/lib/disk/blockdevice.py | |
parent | 0604ed45c3e270ef39b6c80af3787d4ee025c5a1 (diff) |
-rw-r--r-- | archinstall/lib/disk/blockdevice.py | 7 |
diff --git a/archinstall/lib/disk/blockdevice.py b/archinstall/lib/disk/blockdevice.py index ff741f18..16ba0160 100644 --- a/archinstall/lib/disk/blockdevice.py +++ b/archinstall/lib/disk/blockdevice.py @@ -7,12 +7,13 @@ from typing import Optional, Dict, Any, Iterator, Tuple, List, TYPE_CHECKING # https://stackoverflow.com/a/39757388/929999 if TYPE_CHECKING: from .partition import Partition - + from ..exceptions import DiskError, SysCallError from ..output import log from ..general import SysCommand from ..storage import storage + class BlockDevice: def __init__(self, path :str, info :Optional[Dict[str, Any]] = None): if not info: @@ -38,7 +39,9 @@ class BlockDevice: yield self.partitions[partition] def __getitem__(self, key :str, *args :str, **kwargs :str) -> Any: - if key not in self.info: + if hasattr(self, key): + return getattr(self, key) + elif key not in self.info: raise KeyError(f'{self} does not contain information: "{key}"') return self.info[key] |