mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 07:04:16 +02:00
showing console details when upgrading fails
This commit is contained in:
@@ -99,7 +99,7 @@ def update_and_stream(app_ref: str):
|
||||
:param app_ref:
|
||||
:return:
|
||||
"""
|
||||
return system.stream_cmd([BASE_CMD, 'update', '-y', app_ref])
|
||||
return system.cmd_to_subprocess([BASE_CMD, 'update', '-y', app_ref])
|
||||
|
||||
|
||||
def uninstall_and_stream(app_ref: str):
|
||||
|
||||
@@ -15,7 +15,7 @@ from fpakman.view.qt.view_model import ApplicationView
|
||||
|
||||
class UpdateSelectedApps(QThread):
|
||||
|
||||
signal_finished = pyqtSignal()
|
||||
signal_finished = pyqtSignal(bool)
|
||||
signal_output = pyqtSignal(str)
|
||||
|
||||
def __init__(self, manager: ApplicationManager, apps_to_update: List[ApplicationView] = None):
|
||||
@@ -25,13 +25,31 @@ class UpdateSelectedApps(QThread):
|
||||
|
||||
def run(self):
|
||||
|
||||
error = False
|
||||
|
||||
for app in self.apps_to_update:
|
||||
for output in self.manager.update_and_stream(app.model):
|
||||
|
||||
subproc = self.manager.update_and_stream(app.model)
|
||||
|
||||
self.signal_output.emit(' '.join(subproc.args) + '\n')
|
||||
|
||||
for output in subproc.stdout:
|
||||
line = output.decode().strip()
|
||||
if line:
|
||||
self.signal_output.emit(line)
|
||||
|
||||
self.signal_finished.emit()
|
||||
for output in subproc.stderr:
|
||||
line = output.decode().strip()
|
||||
if line:
|
||||
error = True
|
||||
self.signal_output.emit(line)
|
||||
|
||||
self.signal_output.emit('\n')
|
||||
|
||||
if error:
|
||||
break
|
||||
|
||||
self.signal_finished.emit(not error)
|
||||
|
||||
|
||||
class RefreshApps(QThread):
|
||||
|
||||
@@ -373,10 +373,14 @@ class ManageWindow(QWidget):
|
||||
self.thread_update.apps_to_update = to_update
|
||||
self.thread_update.start()
|
||||
|
||||
def _finish_update_selected(self):
|
||||
def _finish_update_selected(self, success: bool):
|
||||
self.finish_action()
|
||||
self._release_lock()
|
||||
self.refresh()
|
||||
|
||||
if success:
|
||||
self.refresh()
|
||||
else:
|
||||
self.checkbox_console.setChecked(True)
|
||||
|
||||
def _update_action_output(self, output: str):
|
||||
self.textarea_output.appendPlainText(output)
|
||||
|
||||
Reference in New Issue
Block a user