index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton.feeds+github@gmail.com> | 2020-07-21 08:17:31 +0200 |
---|---|---|
committer | Anton Hvornum <anton.feeds+github@gmail.com> | 2020-07-21 08:17:31 +0200 |
commit | 2b14aa68d04bf1fb5fbe5dbd7adb9d1c1663a19b (patch) | |
tree | a851efc17d93cfec81279d63074745d2adf084e0 /archinstall | |
parent | 3c0f4cebce2a9526d621c647b2b91d07c4817a68 (diff) |
-rw-r--r-- | archinstall/lib/disk.py | 22 |
diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py index c6fba8ce..7cd8dd0f 100644 --- a/archinstall/lib/disk.py +++ b/archinstall/lib/disk.py @@ -17,6 +17,21 @@ class BlockDevice(): self.info = info self.part_cache = OrderedDict() + def __repr__(self, *args, **kwargs): + return f"BlockDevice({self.device})" + + def __getitem__(self, key, *args, **kwargs): + if not key in self.info: + raise KeyError(f'{self} does not contain information: "{key}"') + return self.info[key] + + def __dump__(self): + return { + 'path' : self.path, + 'info' : self.info, + 'partition_cache' : self.part_cache + } + @property def device(self): """ @@ -69,13 +84,6 @@ class BlockDevice(): all_partitions = self.partitions return [all_partitions[k] for k in all_partitions] - def __repr__(self, *args, **kwargs): - return f"BlockDevice({self.device})" - - def __getitem__(self, key, *args, **kwargs): - if not key in self.info: - raise KeyError(f'{self} does not contain information: "{key}"') - return self.info[key] class Partition(): def __init__(self, path, part_id=None, size=-1, filesystem=None, mountpoint=None, encrypted=False): |