Commit 527a16f8 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

Solver: Get process finished event.

Showing with 11 additions and 3 deletions
+11 -3
......@@ -135,6 +135,7 @@ class AbstractSolver(object):
exe, args,
)
self._process.readyRead.connect(self._data_ready)
self._process.finished.connect(self._finished)
return True
......@@ -149,6 +150,10 @@ class AbstractSolver(object):
if self._output is not None:
self._output.put(s)
def _finished(self, exit_code, exit_status):
if self._output is not None:
self._output.put(exit_code)
def run(self, process, output_queue):
self._process = process
self._output = output_queue
......
......@@ -111,13 +111,16 @@ class SolverLogWindow(ASubMainWindow, ListedSubWindow):
self._alarm.timeout.connect(self.update)
def _log(self, msg):
msg = msg.rsplit('\n')[0]
self.find(QTextEdit, "textEdit").append(msg)
if type(msg) == str:
msg = msg.rsplit('\n')[0]
self.find(QTextEdit, "textEdit").append(msg)
elif type(msg) == int:
self.find(QTextEdit, "textEdit")\
.append(f" *** Solver finished with code {msg}")
def update(self):
while self._output.qsize() != 0:
s = self._output.get()
print(s)
self._log(s)
def start(self):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment