mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Solver: Fix case of space into solver path.
This commit is contained in:
1 parent
06b6d59494
commit
02dafd4694
2 files changed
+36
-11
No files matched your search
+35
-10
@@ -189,9 +189,18 @@ class AbstractSolver(object):
|
||||
|
||||
logger.debug(f"! {cmd}")
|
||||
|
||||
cmd = cmd.split()
|
||||
exe = cmd[0]
|
||||
args = cmd[1:]
|
||||
if cmd[0] == "\"":
|
||||
# Command line executable path is between " char
|
||||
cmd = cmd.split("\"")
|
||||
exe = cmd[1]
|
||||
args = "\"".join(cmd[3:]).split(" ")
|
||||
else:
|
||||
# We suppose the command line executable path as no space char
|
||||
cmd = cmd.replace("\ ", "&_&").split(" ")
|
||||
exe = cmd[0].replace("&_&", "\ ")
|
||||
args = cmd[1:]
|
||||
|
||||
logger.info(f"! {exe} {args}")
|
||||
|
||||
if not os.path.exists(exe):
|
||||
error = f"[ERROR] Path {exe} do not exists"
|
||||
@@ -215,11 +224,20 @@ class AbstractSolver(object):
|
||||
cmd = cmd.replace("@input", self.input_param())
|
||||
cmd = cmd.replace("@dir", self._process.workingDirectory())
|
||||
|
||||
logger.debug(f"! {cmd}")
|
||||
logger.info(f"! {cmd}")
|
||||
|
||||
cmd = cmd.split()
|
||||
exe = cmd[0]
|
||||
args = cmd[1:]
|
||||
if cmd[0] == "\"":
|
||||
# Command line executable path is between " char
|
||||
cmd = cmd.split("\"")
|
||||
exe = cmd[1]
|
||||
args = "\"".join(cmd[3:]).split(" ")
|
||||
else:
|
||||
# We suppose the command line executable path as no space char
|
||||
cmd = cmd.replace("\ ", "&_&").split(" ")
|
||||
exe = cmd[0].replace("&_&", "\ ")
|
||||
args = cmd[1:]
|
||||
|
||||
logger.info(f"! {exe} {args}")
|
||||
|
||||
if not os.path.exists(exe):
|
||||
error = f"[ERROR] Path {exe} do not exists"
|
||||
@@ -246,9 +264,16 @@ class AbstractSolver(object):
|
||||
|
||||
logger.debug(f"! {cmd}")
|
||||
|
||||
cmd = cmd.split()
|
||||
exe = cmd[0]
|
||||
args = cmd[1:]
|
||||
if cmd[0] == "\"":
|
||||
# Command line executable path is between " char
|
||||
cmd = cmd.split("\"")
|
||||
exe = cmd[1]
|
||||
args = "\"".join(cmd[3:]).split(" ")
|
||||
else:
|
||||
# We suppose the command line executable path as no space char
|
||||
cmd = cmd.replace("\ ", "&_&").split(" ")
|
||||
exe = cmd[0].replace("&_&", "\ ")
|
||||
args = cmd[1:]
|
||||
|
||||
if not os.path.exists(exe):
|
||||
error = f"[ERROR] Path {exe} do not exists"
|
||||
|
||||
Reference in new issue
Block a user