mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-09 04:04:15 +02:00
[improvement][arch] unifying the process output when upgrading several repo packages to prevent wrong error returns
This commit is contained in:
@@ -157,18 +157,22 @@ class ProcessHandler:
|
||||
|
||||
return process.subproc.returncode is None or process.subproc.returncode == 0
|
||||
|
||||
def handle_simple(self, proc: SimpleProcess) -> Tuple[bool, str]:
|
||||
def handle_simple(self, proc: SimpleProcess, output_handler=None) -> Tuple[bool, str]:
|
||||
self._notify_watcher(' '.join(proc.instance.args) + '\n')
|
||||
|
||||
output = StringIO()
|
||||
for o in proc.instance.stdout:
|
||||
if o:
|
||||
line = o.decode()
|
||||
|
||||
output.write(line)
|
||||
|
||||
line = line.strip()
|
||||
|
||||
if line:
|
||||
if output_handler:
|
||||
output_handler(line)
|
||||
|
||||
self._notify_watcher(line)
|
||||
|
||||
output.seek(0)
|
||||
|
||||
Reference in New Issue
Block a user