From 3c0963a0a10116342c75c11a5971df99e2e04a7b Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sun, 15 Mar 2020 19:05:55 +0000 Subject: Added a new feature: on_output in sys_command. Passing a on_output function to sys_command forces it to send each output block to the callback. Useful to create progressbars etc. --- archinstall.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/archinstall.py b/archinstall.py index 54cb391e..dfc2926f 100644 --- a/archinstall.py +++ b/archinstall.py @@ -313,6 +313,9 @@ class sys_command():#Thread): print(self.cmd[0], 'gave:', output.decode('UTF-8')) log(self.cmd[0],'gave:', output.decode('UTF-8'), origin='spawn', level=4) + if 'on_output' in self.kwargs: + self.kwargs['on_output'](self, output) + lower = output.lower() broke = False if 'events' in self.kwargs: -- cgit v1.2.3-70-g09d2