return match.group( 1 )
return ''
+
+# calculate and return configuration file id in order to unically identify it
+# for example: for 3.1.0a1 the id is 301000101
+def version_id( fname ):
+ vers = fname.split(".")
+ major = int(vers[0])
+ minor = int(vers[1])
+ mr = re.search(r'^([0-9]+)([A-Za-z]?)([0-9]*)',vers[2])
+ release = dev = 0
+ if mr:
+ release = int(mr.group(1))
+ dev1 = dev2 = 0
+ if len(mr.group(2)): dev1 = ord(mr.group(2))
+ if len(mr.group(3)): dev2 = int(mr.group(3))
+ dev = dev1 * 100 + dev2
+ ver = major
+ ver = ver * 100 + minor
+ ver = ver * 100 + release
+ ver = ver * 10000 + dev
+ return ver
+
+# get user configuration file name
+def userFile():
+ v = version()
+ if not v:
+ return "" # not unknown version
+ filename = "%s/.%src.%s" % (os.environ['HOME'], appname, v)
+ if os.path.exists(filename):
+ return filename # user preferences file for the current version exists
+ # initial id
+ id0 = version_id( v )
+ # get all existing user preferences files
+ files = glob.glob( os.environ['HOME'] + "/." + appname + "rc.*" )
+ f2v = {}
+ for file in files:
+ match = re.search( r'\.%src\.([a-zA-Z0-9.]+)$'%appname, file )
+ if match: f2v[file] = match.group(1)
+ last_file = ""
+ last_version = 0
+ for file in f2v:
+ ver = version_id( f2v[file] )
+ if abs(last_version-id0) > abs(ver-id0):
+ last_version = ver
+ last_file = file
+ return last_file
+
# -----------------------------------------------------------------------------
### xml reader for launch configuration file usage
class xml_parser:
def __init__(self, fileName, _opts ):
- print "Processing ",fileName
+ print "Configure parser: processing %s ..." % fileName
self.space = []
self.opts = _opts
self.section = section_to_skip
# - command line
config_var = appname+'Config'
+# set resources variables if not yet set
+if os.getenv("GUI_ROOT_DIR"):
+ if not os.getenv("SUITRoot"):
+ os.environ["SUITRoot"] = os.getenv("GUI_ROOT_DIR") + "/share/salome"
+ if not os.getenv(config_var):
+ os.environ[config_var] = os.getenv("GUI_ROOT_DIR") + "/share/salome/resources"
+ pass
+else :
+ if not os.getenv("SUITRoot"):
+ os.environ["SUITRoot"] = ""
+ if not os.getenv(config_var):
+ os.environ[config_var] = ""
+
dirs = os.environ[config_var]
#abd error om win32 path like W:\dir\di1
-print 'Search configuration file in dir ', dirs
+#print 'Search configuration file in dir ', dirs
if os.sys.platform == 'win32':
dirs = re.split('[;]', dirs )
else:
p = xml_parser(filename, _opts)
_opts = p.opts
except:
- print 'Can not read launch configuration file ', filename
+ print "Configure parser: Error : can not read configuration file %s" % filename
continue
# SalomeApprc file in user's catalogue
-filename = os.environ['HOME']+'/.'+appname+'rc.'+version()
+filename = userFile()
try:
p = xml_parser(filename, _opts)
_opts = p.opts
except:
- print 'Can not read launch configuration file ', filename
-
+ print 'Configure parser: Error : can not read user configuration file'
args = _opts
list = []
pass
- #print "source=",source
-
result = {}
i = 0
while i < len(source):
cmd_opts = {}
try:
cmd_opts = options_parser(sys.argv[1:])
- #print "opts=",cmd_opts
kernel_root_dir=os.environ["KERNEL_ROOT_DIR"]
except:
cmd_opts["h"] = 1
opterror=0
for opt in cmd_opts:
if not opt in ("h","g","l","f","x","m","e","s","c","p","k","t","i","r"):
- print "command line error: -", opt
+ print "Configure parser: Error : command line error : -%s" % opt
opterror=1
if opterror == 1:
pass
pass
+# if --modules (-m) command line option is not given
+# try SALOME_MODULES environment variable
+if not cmd_opts.has_key( "m" ) and os.getenv( "SALOME_MODULES" ):
+ args[modules_nam] = re.split( "[:;,]", os.getenv( "SALOME_MODULES" ) )
+ pass
+
# 'terminal' must be processed in the end: to deny any 'gui' options
if 't' in cmd_opts:
args[gui_nam] = 0
pass
-#print "args=",args
+# now modify SalomeAppConfig environment variable
+if os.sys.platform == 'win32':
+ dirs = re.split('[;]', os.environ[config_var] )
+else:
+ dirs = re.split('[;|:]', os.environ[config_var] )
+for m in args[modules_nam]:
+ if m not in ["KERNEL", "GUI", ""] and os.getenv("%s_ROOT_DIR"%m):
+ dirs.append( os.getenv("%s_ROOT_DIR"%m) + "/share/salome/resources" )
+os.environ[config_var] = ":".join(dirs)
#!/usr/bin/env python
import sys, os, string, glob, time, pickle
+from server import *
import orbmodule
-process_id = {}
+#process_id = {}
# salome_subdir variable is used for composing paths like $KERNEL_ROOT_DIR/share/salome/resources, etc.
# before moving to SUIT-based gui, instead of salome_subdir there was args['appname'] used.
modules_list = []
if args.has_key("modules"):
modules_list += args["modules"]
- # KERNEL must be last in the list to locate it at the first place in PATH
+ # KERNEL must be last in the list to locate it at the first place in PATH
+ if args["gui"] :
+ modules_list[:0] = ["GUI"]
modules_list[:0] = ["KERNEL"]
modules_list.reverse()
for module in modules_list :
module_variable=module.upper()+"_ROOT_DIR"
if not os.environ.has_key(module_variable):
- #print "*******************************************************"
- #print "*"
- #print "* Environment variable",module_variable,"must be set"
- #print "* Module", module, "will be not available"
- #print "*"
- #print "********************************************************"
+ print "*******************************************************"
+ print "*"
+ print "* Environment variable",module_variable,"must be set"
+ print "* Module", module, "will be not available"
+ print "*"
+ print "********************************************************"
to_remove_list.append(module)
continue
pass
modules_list.remove("KERNEL")
pass
+ while "GUI" in modules_list:
+ modules_list.remove("GUI")
+ pass
+
if "SUPERV" in modules_list and not 'superv' in args['standalone']:
args['standalone'].append("superv")
pass
python_version="python%d.%d" % sys.version_info[0:2]
modules_root_dir_list = []
+ if args["gui"] :
+ modules_list = modules_list[:] + ["GUI"]
modules_list = modules_list[:] + ["KERNEL"]
for module in modules_list :
- module_root_dir = modules_root_dir[module]
- modules_root_dir_list[:0] = [module_root_dir]
- add_path(os.path.join(module_root_dir,"lib",salome_subdir),
- "LD_LIBRARY_PATH")
- add_path(os.path.join(module_root_dir,"bin",salome_subdir),
- "PATH")
- if os.path.exists(module_root_dir + "/examples") :
- add_path(os.path.join(module_root_dir,"examples"),
+ if modules_root_dir.has_key(module):
+ module_root_dir = modules_root_dir[module]
+ modules_root_dir_list[:0] = [module_root_dir]
+ add_path(os.path.join(module_root_dir,"lib",salome_subdir),
+ "LD_LIBRARY_PATH")
+ add_path(os.path.join(module_root_dir,"bin",salome_subdir),
+ "PATH")
+ if os.path.exists(module_root_dir + "/examples") :
+ add_path(os.path.join(module_root_dir,"examples"),
+ "PYTHONPATH")
+ pass
+ add_path(os.path.join(module_root_dir,"bin",salome_subdir),
+ "PYTHONPATH")
+ add_path(os.path.join(module_root_dir,"lib",
+ python_version,"site-packages",
+ salome_subdir),
+ "PYTHONPATH")
+ add_path(os.path.join(module_root_dir,"lib",salome_subdir),
"PYTHONPATH")
- add_path(os.path.join(module_root_dir,"bin",salome_subdir),
- "PYTHONPATH")
- add_path(os.path.join(module_root_dir,"lib",
- python_version,"site-packages",salome_subdir),
- "PYTHONPATH")
- add_path(os.path.join(module_root_dir,"lib",salome_subdir),
- "PYTHONPATH")
- add_path(os.path.join(module_root_dir,"lib",
- python_version,"site-packages",salome_subdir,
- "shared_modules"),
- "PYTHONPATH")
+ add_path(os.path.join(module_root_dir,"lib",
+ python_version,"site-packages",
+ salome_subdir,
+ "shared_modules"),
+ "PYTHONPATH")
+ pass
+ pass
+
os.environ["SALOMEPATH"]=":".join(modules_root_dir_list)
- # special path for logger lib if needeed
+ # set trace environment variable
- os.environ["SALOME_trace"]="local"
+ if not os.environ.has_key("SALOME_trace"):
+ os.environ["SALOME_trace"]="local"
if args['file']:
- os.environ["SALOME_trace"]=args['file'][0]
+ os.environ["SALOME_trace"]="file:"+args['file'][0]
if args['logger']:
os.environ["SALOME_trace"]="with_logger"
- locdir=os.environ['PWD']
- libtracedir=os.path.join(locdir,"libSalomeTrace")
- libtrace = os.path.join(modules_root_dir["KERNEL"],"lib",
- salome_subdir,
- "libSALOMELoggerClient.so.0.0.0")
- libtraceln = os.path.join(libtracedir,"libSALOMELocalTrace.so")
- aCommand = 'rm -rf ' + libtracedir + "; "
- aCommand += 'mkdir ' + libtracedir + "; "
- aCommand += 'ln -s ' + libtrace + " " + libtraceln + "; "
- aCommand += 'ln -s ' + libtrace + " " + libtraceln + ".0; "
- aCommand += 'ln -s ' + libtrace + " " + libtraceln + ".0.0.0; "
- os.system(aCommand)
- add_path(libtracedir, "LD_LIBRARY_PATH")
# set environment for SMESH plugins
pass
if args.has_key("SMESH_plugins"):
for plugin in args["SMESH_plugins"]:
- if os.environ.has_key(plugin.upper()+"_ROOT_DIR"):
+ plugin_root = ""
+ if os.environ.has_key(plugin+"_ROOT_DIR"):
+ plugin_root = os.environ[plugin+"_ROOT_DIR"]
+ else:
+ # workaround to avoid modifications of existing environment
+ if os.environ.has_key(plugin.upper()+"_ROOT_DIR"):
+ plugin_root = os.environ[plugin.upper()+"_ROOT_DIR"]
+ pass
+ pass
+ if plugin_root != "":
os.environ["SMESH_MeshersList"] \
= os.environ["SMESH_MeshersList"]+":"+plugin
- plugin_root = os.environ[plugin.upper()+"_ROOT_DIR"]
if not os.environ.has_key("SALOME_"+plugin+"Resources"):
os.environ["SALOME_"+plugin+"Resources"] \
= plugin_root+"/share/"+args["appname"]+"/resources"
# set environment for SUPERV module
os.environ["ENABLE_MACRO_NODE"]="1"
-
+ # set resources variables if not yet set
+ # Done now by launchConfigureParser.py
+ #if os.getenv("GUI_ROOT_DIR"):
+ #if not os.getenv("SUITRoot"): os.environ["SUITRoot"] = os.getenv("GUI_ROOT_DIR") + "/share/salome"
+ #if not os.getenv("SalomeAppConfig"): os.environ["SalomeAppConfig"] = os.getenv("GUI_ROOT_DIR") + "/share/salome/resources"
+
+ # set CSF_PluginDefaults variable only if it is not customized
+ # by the user
+ if not os.getenv("CSF_PluginDefaults"):
+ os.environ["CSF_PluginDefaults"] \
+ = os.path.join(modules_root_dir["KERNEL"],"share",
+ salome_subdir,"resources")
+ os.environ["CSF_SALOMEDS_ResourcesDefaults"] \
+ = os.path.join(modules_root_dir["KERNEL"],"share",
+ salome_subdir,"resources")
+
+ if "GEOM" in modules_list:
+ print "GEOM OCAF Resources"
+ os.environ["CSF_GEOMDS_ResourcesDefaults"] \
+ = os.path.join(modules_root_dir["GEOM"],"share",
+ salome_subdir,"resources")
+ print "GEOM Shape Healing Resources"
+ os.environ["CSF_ShHealingDefaults"] \
+ = os.path.join(modules_root_dir["GEOM"],"share",
+ salome_subdir,"resources")
# -----------------------------------------------------------------------------
elif args['portkill']:
givenPortKill(str(args['port']))
-# -----------------------------------------------------------------------------
-#
-# Definition des classes d'objets pour le lancement des Server CORBA
-#
-
-class Server:
- """Generic class for CORBA server launch"""
-
- def initArgs(self):
- self.CMD=[]
- self.ARGS=[]
- if self.args['xterm']:
- self.ARGS=['xterm', '-iconic', '-sb', '-sl', '500', '-hold']
-
- def __init__(self,args):
- self.args=args
- self.initArgs()
-
-
- def run(self):
- global process_id
- myargs=self.ARGS
- if self.args['xterm']:
- # (Debian) send LD_LIBRARY_PATH to children shells (xterm)
- env_ld_library_path=['env', 'LD_LIBRARY_PATH='
- + os.getenv("LD_LIBRARY_PATH")]
- myargs = myargs +['-T']+self.CMD[:1]+['-e'] + env_ld_library_path
- command = myargs + self.CMD
- print "command = ", command
- if sys.platform == "win32":
- #pid = os.spawnv(os.P_NOWAIT, command[0], command)
- os.system("start " + string.join(command, " "))
- pid = 0
- else:
- pid = os.spawnvp(os.P_NOWAIT, command[0], command)
- process_id[pid]=self.CMD
-
class InterpServer(Server):
def __init__(self,args):
global process_id
command = self.CMD
print "command = ", command
- pid = os.spawnvp(os.P_NOWAIT, command[0], command)
+ if sys.platform == "win32":
+ import win32pm
+ pid = win32pm.spawnpid( string.join(command, " ") )
+ else:
+ pid = os.spawnvp(os.P_NOWAIT, command[0], command)
process_id[pid]=self.CMD
+ self.PID = pid
# ---
cata_path=[]
list_modules = modules_list[:]
list_modules.reverse()
- for module in ["KERNEL"] + list_modules:
- module_root_dir=modules_root_dir[module]
- module_cata=module+"Catalog.xml"
- print " ", module_cata
- cata_path.extend(
- glob.glob(os.path.join(module_root_dir,
- "share",salome_subdir,
- "resources",module_cata)))
+ if self.args["gui"] :
+ list_modules = ["KERNEL", "GUI"] + list_modules
+ else :
+ list_modules = ["KERNEL"] + list_modules
+ for module in list_modules:
+ if modules_root_dir.has_key(module):
+ module_root_dir=modules_root_dir[module]
+ module_cata=module+"Catalog.xml"
+ #print " ", module_cata
+ cata_path.extend(
+ glob.glob(os.path.join(module_root_dir,
+ "share",salome_subdir,
+ "resources",module_cata)))
+ pass
+ pass
self.CMD=self.SCMD1 + [string.join(cata_path,':')] + self.SCMD2
# ---
# ---
-# class SessionLoader(Server):
-# def __init__(self,args):
-# self.args=args
-# self.initArgs()
-# self.CMD=['SALOME_Session_Loader']
-# if "cppContainer" in self.args['standalone'] \
-# or "cppContainer" in self.args['embedded']:
-# self.CMD=self.CMD+['CPP']
-# if "pyContainer" in self.args['standalone'] \
-# or "pyContainer" in self.args['embedded']:
-# self.CMD=self.CMD+['PY']
-# if "supervContainer" in self.args['containers'] \
-# or "supervContainer" in self.args['standalone']:
-# self.CMD=self.CMD+['SUPERV']
-# if self.args['gui']:
-# self.CMD=self.CMD+['GUI']
-# print self.CMD
-
-# ---
-
class SessionServer(Server):
def __init__(self,args):
- self.args=args
+ self.args = args.copy()
+ # Bug 11512 (Problems with runSalome --xterm on Mandrake and Debian Sarge)
+ self.args['xterm']=0
+ #
self.initArgs()
if sys.platform == "win32":
self.SCMD1=[os.environ["GUI_ROOT_DIR"] + "/win32/" + os.environ["BIN_ENV"] + "/" + 'SALOME_Session_Server' + ".exe"]
self.SCMD2+=['SUPERV']
if self.args['gui']:
self.SCMD2+=['GUI']
- if self.args['splash']:
+ if self.args['splash'] and self.args['gui']:
self.SCMD2+=['SPLASH']
+ if self.args['noexcepthandler']:
+ self.SCMD2+=['noexcepthandler']
+ if self.args.has_key('modules'):
+ self.SCMD2+=['--modules (']
+ for mod in self.args['modules']:
+ self.SCMD2+=[mod + ':']
+ self.SCMD2+=[')']
def setpath(self,modules_list,modules_root_dir):
cata_path=[]
list_modules = modules_list[:]
list_modules.reverse()
- for module in ["KERNEL"] + list_modules:
+ if self.args["gui"] :
+ list_modules = ["KERNEL", "GUI"] + list_modules
+ else :
+ list_modules = ["KERNEL"] + list_modules
+ for module in list_modules:
module_root_dir=modules_root_dir[module]
module_cata=module+"Catalog.xml"
- print " ", module_cata
+ #print " ", module_cata
cata_path.extend(
glob.glob(os.path.join(module_root_dir,"share",
salome_subdir,"resources",
module_cata)))
- if 'moduleCatalog' in self.args['embedded']:
+ if (self.args["gui"]) & ('moduleCatalog' in self.args['embedded']):
self.CMD=self.SCMD1 + [string.join(cata_path,':')] + self.SCMD2
else:
self.CMD=self.SCMD1 + self.SCMD2
else:
self.SCMD1=['SALOME_ContainerManagerServer']
self.SCMD2=[]
- if 'registry' in self.args['embedded']:
- self.SCMD1+=['--with','Registry',
- '(','--salome_session','theSession',')']
- if 'moduleCatalog' in self.args['embedded']:
- self.SCMD1+=['--with','ModuleCatalog','(','-common']
- self.SCMD2+=['-personal',
- '${HOME}/Salome/resources/CatalogModulePersonnel.xml',')']
- if 'study' in self.args['embedded']:
- self.SCMD2+=['--with','SALOMEDS','(',')']
- if 'cppContainer' in self.args['embedded']:
- self.SCMD2+=['--with','Container','(','FactoryServer',')']
+ if args["gui"] :
+ if 'registry' in self.args['embedded']:
+ self.SCMD1+=['--with','Registry',
+ '(','--salome_session','theSession',')']
+ if 'moduleCatalog' in self.args['embedded']:
+ self.SCMD1+=['--with','ModuleCatalog','(','-common']
+ self.SCMD2+=['-personal',
+ '${HOME}/Salome/resources/CatalogModulePersonnel.xml',')']
+ if 'study' in self.args['embedded']:
+ self.SCMD2+=['--with','SALOMEDS','(',')']
+ if 'cppContainer' in self.args['embedded']:
+ self.SCMD2+=['--with','Container','(','FactoryServer',')']
def setpath(self,modules_list,modules_root_dir):
cata_path=[]
list_modules = modules_list[:]
list_modules.reverse()
+ if self.args["gui"] :
+ list_modules = ["GUI"] + list_modules
for module in ["KERNEL"] + list_modules:
- module_root_dir=modules_root_dir[module]
- module_cata=module+"Catalog.xml"
- print " ", module_cata
- cata_path.extend(
- glob.glob(os.path.join(module_root_dir,"share",
- self.args['appname'],"resources",
- module_cata)))
- if 'moduleCatalog' in self.args['embedded']:
+ if modules_root_dir.has_key(module):
+ module_root_dir=modules_root_dir[module]
+ module_cata=module+"Catalog.xml"
+ #print " ", module_cata
+ cata_path.extend(
+ glob.glob(os.path.join(module_root_dir,"share",
+ self.args['appname'],"resources",
+ module_cata)))
+ pass
+ pass
+ if (self.args["gui"]) & ('moduleCatalog' in self.args['embedded']):
self.CMD=self.SCMD1 + [string.join(cata_path,':')] + self.SCMD2
else:
self.CMD=self.SCMD1 + self.SCMD2
def startGUI():
"""Salome Session Graphic User Interface activation"""
+ import Engines
import SALOME
+ import SALOMEDS
+ import SALOME_ModuleCatalog
+ reload(Engines)
+ reload(SALOME)
+ reload(SALOMEDS)
import SALOME_Session_idl
session=clt.waitNS("/Kernel/Session",SALOME.Session)
session.GetInterface()
init_time = os.times()
print "startSalome ", args
- print "sysPATH=",sys.path
#
# Initialisation ORB et Naming Service
#
- clt=orbmodule.client()
-
- #
- # Lancement Session Server
-
- mySessionServ = SessionServer(args)
- mySessionServ.setpath(modules_list,modules_root_dir)
- mySessionServ.run()
+ clt=orbmodule.client(args)
# (non obligatoire) Lancement Logger Server
# et attente de sa disponibilite dans le naming service
# Notify Server launch
#
- #print "Notify Server to launch"
- #mpv
- #myServer=NotifyServer(args,modules_root_dir)
- #myServer.run()
+# print "Notify Server to launch"
+
+# myServer=NotifyServer(args,modules_root_dir)
+# myServer.run()
+
+ # Lancement Session Server (to show splash ASAP)
+ #
+
+ if args["gui"]:
+ mySessionServ = SessionServer(args)
+ mySessionServ.setpath(modules_list,modules_root_dir)
+ mySessionServ.run()
#
# Lancement Registry Server,
# attente de la disponibilite du Registry dans le Naming Service
#
- if 'registry' not in args['embedded']:
+ if ('registry' not in args['embedded']) | (args["gui"] == 0) :
myServer=RegistryServer(args)
myServer.run()
- clt.waitNS("/Registry")
+ if sys.platform == "win32":
+ clt.waitNS("/Registry")
+ else:
+ clt.waitNSPID("/Registry",myServer.PID)
#
# Lancement Catalog Server,
# attente de la disponibilite du Catalog Server dans le Naming Service
#
- if 'moduleCatalog' not in args['embedded']:
+
+ if ('moduleCatalog' not in args['embedded']) | (args["gui"] == 0):
cataServer=CatalogServer(args)
cataServer.setpath(modules_list,modules_root_dir)
cataServer.run()
import SALOME_ModuleCatalog
- clt.waitNS("/Kernel/ModulCatalog",SALOME_ModuleCatalog.ModuleCatalog)
+ if sys.platform == "win32":
+ clt.waitNS("/Kernel/ModulCatalog",SALOME_ModuleCatalog.ModuleCatalog)
+ else:
+ clt.waitNSPID("/Kernel/ModulCatalog",cataServer.PID,SALOME_ModuleCatalog.ModuleCatalog)
#
# Lancement SalomeDS Server,
salome_subdir,"resources")
print "ARGS = ",args
- if 'study' not in args['embedded']:
+ if ('study' not in args['embedded']) | (args["gui"] == 0):
print "RunStudy"
myServer=SalomeDSServer(args)
myServer.run()
- clt.waitNS("/myStudyManager")
+ if sys.platform == "win32":
+ clt.waitNS("/myStudyManager")
+ else:
+ clt.waitNSPID("/myStudyManager",myServer.PID)
#
# Lancement ContainerManagerServer
if 'cppContainer' in args['standalone']:
myServer=ContainerCPPServer(args)
myServer.run()
- clt.waitNS("/Containers/" + theComputer + "/FactoryServer")
+ if sys.platform == "win32":
+ clt.waitNS("/Containers/" + theComputer + "/FactoryServer")
+ else:
+ clt.waitNSPID("/Containers/" + theComputer + "/FactoryServer",myServer.PID)
#
# Lancement Container Python local,
if 'pyContainer' in args['standalone']:
myServer=ContainerPYServer(args)
myServer.run()
- clt.waitNS("/Containers/" + theComputer + "/FactoryServerPy")
+ if sys.platform == "win32":
+ clt.waitNS("/Containers/" + theComputer + "/FactoryServerPy")
+ else:
+ clt.waitNSPID("/Containers/" + theComputer + "/FactoryServerPy",myServer.PID)
#
# Lancement Container Supervision local,
if 'supervContainer' in args['standalone']:
myServer=ContainerSUPERVServer(args)
myServer.run()
- clt.waitNS("/Containers/" + theComputer + "/SuperVisionContainer")
-##----------------
-
+ if sys.platform == "win32":
+ clt.waitNS("/Containers/" + theComputer + "/SuperVisionContainer")
+ else:
+ clt.waitNSPID("/Containers/" + theComputer + "/SuperVisionContainer",myServer.PID)
+
+ #
# Attente de la disponibilite du Session Server dans le Naming Service
#
-
- import SALOME
- import SALOME_Session_idl
- session=clt.waitNS("/Kernel/Session",SALOME.Session)
+
+ if args["gui"]:
+##----------------
+ import Engines
+ import SALOME
+ import SALOMEDS
+ import SALOME_ModuleCatalog
+ reload(Engines)
+ reload(SALOME)
+ reload(SALOMEDS)
+ import SALOME_Session_idl
+ if sys.platform == "win32":
+ session=clt.waitNS("/Kernel/Session",SALOME.Session)
+ else:
+ session=clt.waitNSPID("/Kernel/Session",mySessionServ.PID,SALOME.Session)
end_time = os.times()
print
anInterp=InterpServer(args)
anInterp.run()
- print "sysPATH2=",sys.path
return clt
# -----------------------------------------------------------------------------
save list of process, give info to user,
show registered objects in Naming Service.
"""
+ global process_id
clt=None
try:
print "--- erreur au lancement Salome ---"
#print process_id
-
-# filedict = '/tmp/' + os.getenv('USER') + "_" + str(args['port']) \
-# + '_' + args['appname'].upper() + '_pidict'
-# replaced args['appname'] by "SALOME" because in killSalome.py use of 'SALOME' in file name is hardcoded.
- filedict = os.getenv("HOME") + '/' + os.getenv('USER') + "_" + str(args['port']) \
- + '_' + 'SALOME' + '_pidict'
+
+ from killSalomeWithPort import getPiDict
+ filedict = getPiDict(args['port'])
+
process_ids = []
try:
fpid=open(filedict, 'r')