Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-02-07 15:05:23 +0100
committerAnton Hvornum <anton@hvornum.se>2021-02-07 15:05:23 +0100
commit2262cd6196dd487b3dfc4524de1eea9b747db0c0 (patch)
tree96c5a0235c467d3d8b64de821dbe4b19322d82d5 /archinstall
parentd527e215fce1da04e07556d2dbe787e16dba550b (diff)
Made BlockDevices() iterable, iterting over each partition
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/disk.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py
index 588054a0..ffd3e044 100644
--- a/archinstall/lib/disk.py
+++ b/archinstall/lib/disk.py
@@ -22,6 +22,10 @@ class BlockDevice():
def __repr__(self, *args, **kwargs):
return f"BlockDevice({self.device})"
+ def __iter__(self):
+ for partition in self.partitions:
+ yield partition
+
def __getitem__(self, key, *args, **kwargs):
if key not in self.info:
raise KeyError(f'{self} does not contain information: "{key}"')