# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
import subprocess
import re
from salomeContextUtils import getScriptsAndArgs, formatScriptsAndArgs, getShortAndExtraArgs
+from salome_utils import getUserName
# Use to display newlines (\n) in epilog
class MyParser(OptionParser):
#
#
-def configureSession(args=[], exe=None):
+def configureSession(args=None, exe=None):
+ if args is None:
+ args = []
if exe:
usage = "Usage: %s [options] [command] [-- <extra>]"%exe
else:
# neither MACHINE nor PORT are given
# --- set omniORB configuration to current session if any
omniorbUserPath = os.environ['OMNIORB_USER_PATH']
- fileOmniConfig = omniorbUserPath + '/.omniORB_' + os.environ['USER'] + '_last.cfg'
+ fileOmniConfig = omniorbUserPath + '/.omniORB_' + getUserName() + '_last.cfg'
if os.path.isfile(fileOmniConfig):
os.environ['OMNIORB_CONFIG'] = fileOmniConfig
# --- set environment variables for port and hostname of NamingService
# --- set the OMNIORB_CONFIG file and environment relative to this run of SALOME
def _writeConfigFile(port, host):
path = os.environ['OMNIORB_USER_PATH']
- kwargs = {'with_username' : os.environ['USER']}
+ kwargs = {'with_username' : getUserName()}
from ORBConfigFile import writeORBConfigFile
[ filename, msgSize ] = writeORBConfigFile(path, host, port, kwargs)
return ("".join(outmsg), "".join(errmsg))
else:
absoluteAppliPath = os.getenv('ABSOLUTE_APPLI_PATH','')
- cmd = ["/bin/bash", "--rcfile", absoluteAppliPath + "/.bashrc" ]
+ if sys.platform == "win32":
+ cmd = ["cmd", "/K", "set PROMPT=[SALOME] $P$G"]
+ else:
+ cmd = ["/bin/bash", "--rcfile", absoluteAppliPath + "/.bashrc" ]
proc = subprocess.Popen(cmd, shell=False, close_fds=True)
return proc.communicate()
#