mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 03:34:15 +02:00
thread process handling improvement
This commit is contained in:
@@ -11,7 +11,6 @@ from bauh_api.exception import NoInternetException
|
|||||||
from bauh_api.util.cache import Cache
|
from bauh_api.util.cache import Cache
|
||||||
from bauh_api.util.system import SystemProcess
|
from bauh_api.util.system import SystemProcess
|
||||||
|
|
||||||
from bauh.view.qt import dialog
|
|
||||||
from bauh.view.qt.view_model import ApplicationView
|
from bauh.view.qt.view_model import ApplicationView
|
||||||
|
|
||||||
|
|
||||||
@@ -27,7 +26,7 @@ class AsyncAction(QThread, ProcessHandler):
|
|||||||
|
|
||||||
success, already_succeeded = True, False
|
success, already_succeeded = True, False
|
||||||
|
|
||||||
proc.subproc.wait()
|
proc.wait()
|
||||||
|
|
||||||
for output in proc.subproc.stdout:
|
for output in proc.subproc.stdout:
|
||||||
line = output.decode().strip()
|
line = output.decode().strip()
|
||||||
@@ -43,13 +42,14 @@ class AsyncAction(QThread, ProcessHandler):
|
|||||||
for output in proc.subproc.stderr:
|
for output in proc.subproc.stderr:
|
||||||
line = output.decode().strip()
|
line = output.decode().strip()
|
||||||
if line:
|
if line:
|
||||||
if proc.wrong_error_phrase and proc.wrong_error_phrase in line:
|
signal.emit(line)
|
||||||
continue
|
|
||||||
else:
|
if proc.check_error_output:
|
||||||
success = False
|
if proc.wrong_error_phrase and proc.wrong_error_phrase in line:
|
||||||
signal.emit(line)
|
continue
|
||||||
|
else:
|
||||||
|
success = False
|
||||||
|
|
||||||
proc.subproc.communicate()
|
|
||||||
return proc.subproc.returncode is None or proc.subproc.returncode == 0
|
return proc.subproc.returncode is None or proc.subproc.returncode == 0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user