Skip to content

Commit

Permalink
[Exporter] - Handling runScript for exporter protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-oscarsson committed Mar 19, 2024
1 parent 8f13b5d commit 3ed02c8
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions mxcubecore/Command/exporter/ExporterClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,22 @@ def execute(self, method, pars=None, timeout=-1):
pars(str): parameters
timeout(float): Timeout [s]
"""

# runScript returns results in a different way than any other
# comand, fix on MD side ?
if method == "runScript" and pars is not None:
pars = pars[0].split(",")

cmd = "{} {} ".format(CMD_SYNC_CALL, method)

if pars is not None:
for par in pars:
if isinstance(par, (list, tuple)):
par = self.create_array_parameter(par)
cmd += str(par) + PARAMETER_SEPARATOR
if isinstance(pars, (list, tuple)):
for par in pars:
if isinstance(par, (list, tuple)):
par = self.create_array_parameter(par)
cmd += str(par) + PARAMETER_SEPARATOR
else:
cmd += str(pars)

ret = self.send_receive(cmd, timeout)
return self.__process_return(ret)
Expand Down

0 comments on commit 3ed02c8

Please sign in to comment.