Salome HOME
Python container is obsolete
[modules/kernel.git] / bin / runSalome.py
index 676489e1fc68a767c66392553c4696e409c8149a..62252e6e2c8671ded5e51b14ffcc1e76f5f9c883 100755 (executable)
@@ -32,7 +32,6 @@ import setenv
 from launchConfigureParser import verbose
 from server import process_id, Server
 import json
-from salomeLauncherUtils import formatScriptsAndArgs
 import subprocess
 
 # -----------------------------------------------------------------------------
@@ -615,11 +614,6 @@ def startSalome(args, modules_list, modules_root_dir):
         else:
           clt.waitNSPID("/Containers/" + theComputer + "/FactoryServer",myServer.PID)
 
-    #
-    # Launch local Python Container (FactoryServerPy),
-    # and wait until it is registered in naming service
-    #
-
     if 'pyContainer' in args['standalone']:
         raise Exception('Python containers no longer supported')
 
@@ -677,7 +671,7 @@ def startSalome(args, modules_list, modules_root_dir):
             import readline
         except ImportError:
             pass
-    
+
     # siman session paramenters and checkout processing
     if simanStudyName(args):
         print '**********************************************'
@@ -698,7 +692,7 @@ def startSalome(args, modules_list, modules_root_dir):
             mySession = obj._narrow(SALOME.Session)
             mySession.emitMessage("simanCheckoutDone " + simanStudyName(args))
         print '**********************************************'
-        
+
     return clt
 
 # -----------------------------------------------------------------------------
@@ -779,10 +773,12 @@ def useSalome(args, modules_list, modules_root_dir):
                 if not args['gui'] or not args['session_gui']:
                     toimport = args['pyscript']
 
+        from salomeLauncherUtils import formatScriptsAndArgs
         command = formatScriptsAndArgs(toimport)
         if command:
             proc = subprocess.Popen(command, shell=True)
-            proc.wait()
+            res = proc.wait()
+            if res: sys.exit(1) # if there's an error when executing script, we should explicitly exit
 
     return clt
 
@@ -830,16 +826,13 @@ def no_main():
 def main():
     """Salome launch as a main application"""
 
-    ### TEMP >>> ###
-    if not os.getenv("OMNIORB_USER_PATH"):
-        homePath = os.path.realpath(os.path.expanduser('~'))
-        #defaultOmniorbUserPath = os.path.join(homePath, ".salomeConfig/USERS")
-        defaultOmniorbUserPath = homePath
-        if os.getenv("APPLI"):
-            defaultOmniorbUserPath = os.path.join(homePath, os.getenv("APPLI"), "USERS")
-        os.environ["OMNIORB_USER_PATH"] = defaultOmniorbUserPath
-        pass
-    ### <<< TEMP ###
+    # define folder to store omniorb config (initially in virtual application folder)
+    try:
+        from salomeLauncherUtils import setOmniOrbUserPath
+        setOmniOrbUserPath()
+    except Exception, e:
+        print e
+        sys.exit(1)
 
     from salome_utils import getHostName
     print "runSalome running on %s" % getHostName()