Skip to content
Snippets Groups Projects
Commit ca29a67a authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

arguments in run() are now optional (I think we should remove them altogether...

arguments in run() are now optional (I think we should remove them altogether - it's too error prone and is clearly not necessary) + fallback on os.system() if no socket is provided. One more nice idea from Fabrice :-)
parent afc1c66b
Branches
Tags
No related merge requests found
...@@ -323,13 +323,15 @@ class client : ...@@ -323,13 +323,15 @@ class client :
if t == self._GMSH_STOP : if t == self._GMSH_STOP :
self.NumSubClients -= 1 self.NumSubClients -= 1
def run(self, name, command, arguments): def run(self, name, command, arguments=''):
if not self.socket : # create command line
return
if self.action == "check": if self.action == "check":
msg = [name, command] cmd = command
else: else:
msg = [name, command + ' ' + arguments] cmd = command + ' ' + arguments
if not self.socket :
return os.system(cmd);
msg = [name, cmd]
self._send(self._GMSH_CONNECT, '\0'.join(msg)) self._send(self._GMSH_CONNECT, '\0'.join(msg))
self.NumSubClients +=1 self.NumSubClients +=1
self._wait_on_subclients() # makes the subclient blocking self._wait_on_subclients() # makes the subclient blocking
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment