#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-import multiprocessing
-import time
-import socket
-
import os
import sys
-import threading
-import SocketServer
try:
import cPickle as pickle
except:
import pickle
-import struct
-import ctypes
-
import logging
def createLogger():
logger = logging.getLogger(__name__)
#
logger = createLogger()
-
-if sys.platform == 'win32':
- import multiprocessing.reduction # make sockets pickable/inheritable
-
-multiprocessing.freeze_support() # Add support for when a program which uses multiprocessing has been frozen to produce a Windows executable.
-
#------------------------------------
# A file locker (Linux only)
import fcntl
scriptArgs = getScriptsAndArgs(args)
command = formatScriptsAndArgs(scriptArgs)
if command:
- command = command.split(' ')
- proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- return proc.communicate()
+ sep = ";"
+ if sys.platform == "win32":
+ sep= "&"
+ command = command.split(sep)
+ outmsg = []
+ errmsg = []
+ for cmd in command:
+ cmd = cmd.strip().split(' ')
+ proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ (stdoutdata, stderrdata) = proc.communicate()
+ if stdoutdata or stderrdata:
+ outmsg.append(stdoutdata)
+ errmsg.append(stderrdata)
+
+ return ("".join(outmsg), "".join(errmsg))
else:
absoluteAppliPath = os.getenv('ABSOLUTE_APPLI_PATH','')
cmd = ["/bin/bash", "--rcfile", absoluteAppliPath + "/.bashrc" ]
self._logger = logging.getLogger(__name__)
#self._logger.setLevel(logging.DEBUG)
self._logger.setLevel(logging.ERROR)
- return self._logger;
+ return self._logger
#
###