diff --git a/src/Solver/ASolver.py b/src/Solver/ASolver.py index bfb47aa7..b4285923 100644 --- a/src/Solver/ASolver.py +++ b/src/Solver/ASolver.py @@ -193,6 +193,11 @@ class AbstractSolver(object): exe = cmd[0] args = cmd[1:] + if not os.path.exists(exe): + error = f"[ERROR] Path {exe} do not exists" + logger.info(error) + return error + self._process.start( exe, args, ) @@ -216,6 +221,11 @@ class AbstractSolver(object): exe = cmd[0] args = cmd[1:] + if not os.path.exists(exe): + error = f"[ERROR] Path {exe} do not exists" + logger.info(error) + return error + self._process.start( exe, args, ) @@ -240,6 +250,11 @@ class AbstractSolver(object): exe = cmd[0] args = cmd[1:] + if not os.path.exists(exe): + error = f"[ERROR] Path {exe} do not exists" + logger.info(error) + return error + self._process.start( exe, args, ) @@ -255,7 +270,9 @@ class AbstractSolver(object): def _run_next(self): self._step += 1 if self._step < len(self._runs): - self._runs[self._step]() + res = self._runs[self._step]() + if res is not True: + self._output.put(res) else: self._status = STATUS.STOPED @@ -281,7 +298,9 @@ class AbstractSolver(object): ] self._step = 0 # Run first step - self._runs[0]() + res = self._runs[0]() + if res is not True: + self._output.put(res) def kill(self): if self._process is None: diff --git a/src/View/RunSolver/Window.py b/src/View/RunSolver/Window.py index dba5a16e..4f915950 100644 --- a/src/View/RunSolver/Window.py +++ b/src/View/RunSolver/Window.py @@ -198,7 +198,10 @@ class SolverLogWindow(ASubMainWindow, ListedSubWindow): while self._output.qsize() != 0: s = self._output.get() - self._log(s) + if type(s) is str and "[ERROR]" in s: + self._log(s, color="red") + else: + self._log(s) def start(self): if self._solver.is_stoped():