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
- modules_list[:0] = ["GUI"]
+ # 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()
python_version="python%d.%d" % sys.version_info[0:2]
modules_root_dir_list = []
- modules_list = modules_list[:] + ["GUI"]
+ if args["gui"] :
+ modules_list = modules_list[:] + ["GUI"]
modules_list = modules_list[:] + ["KERNEL"]
for module in modules_list :
if modules_root_dir.has_key(module):
# set environment for SUPERV module
os.environ["ENABLE_MACRO_NODE"]="1"
# 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("SalomeAppConfig"): os.environ["SalomeAppConfig"] = os.getenv("GUI_ROOT_DIR") + "/share/salome/resources"
- pass
+ # 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
cata_path=[]
list_modules = modules_list[:]
list_modules.reverse()
- for module in ["KERNEL", "GUI"] + list_modules:
+ 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"
cata_path=[]
list_modules = modules_list[:]
list_modules.reverse()
- for module in ["KERNEL", "GUI"] + 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
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
self.initArgs()
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()
- for module in ["KERNEL", "GUI"] + list_modules:
+ if self.args["gui"] :
+ list_modules = ["GUI"] + list_modules
+ for module in ["KERNEL"] + list_modules:
if modules_root_dir.has_key(module):
module_root_dir=modules_root_dir[module]
module_cata=module+"Catalog.xml"
module_cata)))
pass
pass
- 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
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()
# 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.waitNSPID("/Registry",myServer.PID)
#
- 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()
#
#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()
# Lancement Session Server
#
- mySessionServ = SessionServer(args)
- mySessionServ.setpath(modules_list,modules_root_dir)
- mySessionServ.run()
+ if args["gui"]:
+ mySessionServ = SessionServer(args)
+ mySessionServ.setpath(modules_list,modules_root_dir)
+ mySessionServ.run()
##----------------
- # Attente de la disponibilite du Session Server dans le Naming Service
- #
+ # Attente de la disponibilite du Session Server dans le Naming Service
+ #
- import SALOME
- import SALOME_Session_idl
- session=clt.waitNSPID("/Kernel/Session",mySessionServ.PID,SALOME.Session)
+ import Engines
+ import SALOME
+ import SALOMEDS
+ import SALOME_ModuleCatalog
+ reload(Engines)
+ reload(SALOME)
+ reload(SALOMEDS)
+ import SALOME_Session_idl
+ session=clt.waitNSPID("/Kernel/Session",mySessionServ.PID,SALOME.Session)
end_time = os.times()
print