X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=bin%2FrunSalome.py;h=722629ad4694265738e3dee09443f937a813f01c;hb=7abfafb698042a8635b7cbf9d2347937f2036ba8;hp=7bc9a4c07c2e2d463755bdfb794f88554a4d2db2;hpb=1a9c06c1b6b7bb7a2a9787229e1c113f4c81cb0c;p=modules%2Fkernel.git diff --git a/bin/runSalome.py b/bin/runSalome.py index 7bc9a4c07..722629ad4 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -1,11 +1,30 @@ #!/usr/bin/env python +# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG +# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + import sys, os, string, glob, time, pickle import orbmodule process_id = {} -# salome_subdir variable is used for composing paths like $KERNEL_ROOT_DIR/share/salome/resources, etc. +# salome_subdir variable is used for composing paths like $KERNEL_ROOT_DIR/share/salome/resources/kernel, etc. # before moving to SUIT-based gui, instead of salome_subdir there was args['appname'] used. # but after - 'appname' = "SalomeApp", so using it in making the subdirectory is an error. salome_subdir = "salome" @@ -153,7 +172,7 @@ def set_env(args, modules_list, modules_root_dir): os.environ["SMESH_MeshersList"]="StdMeshers" if not os.environ.has_key("SALOME_StdMeshersResources"): os.environ["SALOME_StdMeshersResources"] \ - = modules_root_dir["SMESH"]+"/share/"+args["appname"]+"/resources" + = modules_root_dir["SMESH"]+"/share/"+args["appname"]+"/resources/smesh" pass if args.has_key("SMESH_plugins"): for plugin in args["SMESH_plugins"]: @@ -171,7 +190,7 @@ def set_env(args, modules_list, modules_root_dir): = os.environ["SMESH_MeshersList"]+":"+plugin if not os.environ.has_key("SALOME_"+plugin+"Resources"): os.environ["SALOME_"+plugin+"Resources"] \ - = plugin_root+"/share/"+args["appname"]+"/resources" + = plugin_root+"/share/"+args["appname"]+"/resources/"+plugin.lower() add_path(os.path.join(plugin_root,"lib",python_version, "site-packages",salome_subdir), "PYTHONPATH") @@ -191,28 +210,27 @@ def set_env(args, modules_list, modules_root_dir): # 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" + #if not os.getenv("SalomeAppConfig"): os.environ["SalomeAppConfig"] = os.getenv("GUI_ROOT_DIR") + "/share/salome/resources/gui" # 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") + salome_subdir,"resources","kernel") os.environ["CSF_SALOMEDS_ResourcesDefaults"] \ = os.path.join(modules_root_dir["KERNEL"],"share", - salome_subdir,"resources") + salome_subdir,"resources","kernel") 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") + salome_subdir,"resources","geom") print "GEOM Shape Healing Resources" os.environ["CSF_ShHealingDefaults"] \ = os.path.join(modules_root_dir["GEOM"],"share", - salome_subdir,"resources") + salome_subdir,"resources","geom") # ----------------------------------------------------------------------------- @@ -335,10 +353,21 @@ class CatalogServer(Server): 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 os.path.exists(os.path.join(module_root_dir, + "share",salome_subdir, + "resources",module.lower(), + module_cata)): + cata_path.extend( + glob.glob(os.path.join(module_root_dir, + "share",salome_subdir, + "resources",module.lower(), + module_cata))) + else: + 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 @@ -448,10 +477,20 @@ class SessionServer(Server): 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 os.path.exists(os.path.join(module_root_dir, + "share",salome_subdir, + "resources",module.lower(), + module_cata)): + cata_path.extend( + glob.glob(os.path.join(module_root_dir,"share", + salome_subdir,"resources", + module.lower(),module_cata))) + else: + cata_path.extend( + glob.glob(os.path.join(module_root_dir,"share", + salome_subdir,"resources", + module_cata))) + pass if (self.args["gui"]) & ('moduleCatalog' in self.args['embedded']): self.CMD=self.SCMD1 + [string.join(cata_path,':')] + self.SCMD2 else: @@ -489,10 +528,19 @@ class ContainerManagerServer(Server): 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 os.path.exists(os.path.join(module_root_dir, + "share",salome_subdir, + "resources",module.lower(), + module_cata)): + cata_path.extend( + glob.glob(os.path.join(module_root_dir,"share", + self.args['appname'],"resources", + module.lower(),module_cata))) + else: + 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']): @@ -507,7 +555,7 @@ class NotifyServer(Server): self.modules_root_dir=modules_root_dir myLogName = os.environ["LOGNAME"] self.CMD=['notifd','-c', - self.modules_root_dir["KERNEL"] +'/share/salome/resources/channel.cfg', + self.modules_root_dir["KERNEL"] +'/share/salome/resources/kernel/channel.cfg', '-DFactoryIORFileName=/tmp/'+myLogName+'_rdifact.ior', '-DChannelIORFileName=/tmp/'+myLogName+'_rdichan.ior', '-DReportLogFile=/tmp/'+myLogName+'_notifd.report',