mirror of https://gitlab.com/pamhyr/pamhyr2
Solver: Add error message when command executable do not exists.
parent
464209b6e5
commit
61f31403d4
|
|
@ -193,6 +193,11 @@ class AbstractSolver(object):
|
||||||
exe = cmd[0]
|
exe = cmd[0]
|
||||||
args = cmd[1:]
|
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(
|
self._process.start(
|
||||||
exe, args,
|
exe, args,
|
||||||
)
|
)
|
||||||
|
|
@ -216,6 +221,11 @@ class AbstractSolver(object):
|
||||||
exe = cmd[0]
|
exe = cmd[0]
|
||||||
args = cmd[1:]
|
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(
|
self._process.start(
|
||||||
exe, args,
|
exe, args,
|
||||||
)
|
)
|
||||||
|
|
@ -240,6 +250,11 @@ class AbstractSolver(object):
|
||||||
exe = cmd[0]
|
exe = cmd[0]
|
||||||
args = cmd[1:]
|
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(
|
self._process.start(
|
||||||
exe, args,
|
exe, args,
|
||||||
)
|
)
|
||||||
|
|
@ -255,7 +270,9 @@ class AbstractSolver(object):
|
||||||
def _run_next(self):
|
def _run_next(self):
|
||||||
self._step += 1
|
self._step += 1
|
||||||
if self._step < len(self._runs):
|
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:
|
else:
|
||||||
self._status = STATUS.STOPED
|
self._status = STATUS.STOPED
|
||||||
|
|
||||||
|
|
@ -281,7 +298,9 @@ class AbstractSolver(object):
|
||||||
]
|
]
|
||||||
self._step = 0
|
self._step = 0
|
||||||
# Run first step
|
# Run first step
|
||||||
self._runs[0]()
|
res = self._runs[0]()
|
||||||
|
if res is not True:
|
||||||
|
self._output.put(res)
|
||||||
|
|
||||||
def kill(self):
|
def kill(self):
|
||||||
if self._process is None:
|
if self._process is None:
|
||||||
|
|
|
||||||
|
|
@ -198,6 +198,9 @@ class SolverLogWindow(ASubMainWindow, ListedSubWindow):
|
||||||
|
|
||||||
while self._output.qsize() != 0:
|
while self._output.qsize() != 0:
|
||||||
s = self._output.get()
|
s = self._output.get()
|
||||||
|
if type(s) is str and "[ERROR]" in s:
|
||||||
|
self._log(s, color="red")
|
||||||
|
else:
|
||||||
self._log(s)
|
self._log(s)
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue