Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/general.py
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall/lib/general.py')
-rw-r--r--archinstall/lib/general.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py
index 4d3257ba..f0be7972 100644
--- a/archinstall/lib/general.py
+++ b/archinstall/lib/general.py
@@ -322,6 +322,15 @@ class SysCommand:
for line in self.session:
yield line
+ def __getitem__(self, key):
+ if type(key) is slice:
+ start = key.start if key.start else 0
+ end = key.stop if key.stop else len(self.session._trace_log)
+
+ return self.session._trace_log[start:end]
+ else:
+ raise ValueError("SysCommand() doesn't have key & value pairs, only slices, SysCommand('ls')[:10] as an example.")
+
def __repr__(self, *args, **kwargs):
return self.session._trace_log.decode('UTF-8')