Solver: Add error message when command executable do not exists.

This commit is contained in:
Pierre-Antoine Rouby committed 2023-08-04 11:20:15 +02:00
1 parent 464209b6e5
commit 61f31403d4
2 files changed
+24 -2

No files matched your search

+21 -2
View File
@@ -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:
+3
View File
@@ -198,6 +198,9 @@ class SolverLogWindow(ASubMainWindow, ListedSubWindow):
while self._output.qsize() != 0:
s = self._output.get()
if type(s) is str and "[ERROR]" in s:
self._log(s, color="red")
else:
self._log(s)
def start(self):