Salome HOME
CMake: Sphinx: simplifying Win32 command
[modules/kernel.git] / bin / runSalome.py
index e129a4ff27f8e620b189fd467086df819855f6a5..44a9693da4f9c8278428d69387ce091c82c486f3 100755 (executable)
@@ -32,11 +32,6 @@ import setenv
 from launchConfigureParser import verbose
 from server import process_id, Server
 
-if sys.platform == "win32":
-    SEP = ";"
-else:
-    SEP = ":"
-
 # -----------------------------------------------------------------------------
 
 from killSalome import killAllPorts
@@ -132,7 +127,7 @@ def get_cata_path(list_modules,modules_root_dir):
                     cata_path.append(cata_file)
                     modules_cata[module]=cata_file
 
-    for path in os.getenv("SALOME_CATALOGS_PATH","").split(SEP):
+    for path in os.getenv("SALOME_CATALOGS_PATH","").split(os.pathsep):
         if os.path.exists(path):
             for cata_file in glob.glob(os.path.join(path,"*Catalog.xml")):
                 module_name= os.path.basename(cata_file)[:-11]
@@ -200,17 +195,6 @@ class ContainerCPPServer(Server):
 
 # ---
 
-class ContainerPYServer(Server):
-    def __init__(self,args):
-        self.args=args
-        self.initArgs()
-        if sys.platform == "win32":
-          self.CMD=[os.environ["PYTHONBIN"], '\"'+os.environ["KERNEL_ROOT_DIR"] + '/bin/salome/SALOME_ContainerPy.py'+'\"','FactoryServerPy']
-        else:
-          self.CMD=['SALOME_ContainerPy.py','FactoryServerPy']
-
-# ---
-
 class LoggerServer(Server):
     def __init__(self,args):
         self.args=args
@@ -262,7 +246,7 @@ class SessionServer(Server):
         if 'cppContainer' in self.args['standalone'] or 'cppContainer' in self.args['embedded']:
             self.SCMD2+=['CPP']
         if 'pyContainer' in self.args['standalone'] or 'pyContainer' in self.args['embedded']:
-            self.SCMD2+=['PY']
+            raise Exception('Python containers no longer supported')
         if self.args['gui']:
             session_gui = True
             if self.args.has_key('session_gui'):
@@ -430,14 +414,12 @@ def startSalome(args, modules_list, modules_root_dir):
     if args['wake_up_session']:
         if "OMNIORB_CONFIG" not in os.environ:
             from salome_utils import generateFileName
-            home  = os.getenv("HOME")
-            appli = os.getenv("APPLI")
+            omniorbUserPath = os.getenv("OMNIORB_USER_PATH")
             kwargs={}
-            if appli is not None:
-                home = os.path.join(os.path.realpath(home), appli,"USERS")
-                kwargs["with_username"] = True
-                pass
-            last_running_config = generateFileName(home, prefix="omniORB",
+            if omniorbUserPath is not None:
+                kwargs["with_username"]=True
+
+            last_running_config = generateFileName(omniorbUserPath, prefix="omniORB",
                                                    suffix="last",
                                                    extension="cfg",
                                                    hidden=True,
@@ -485,11 +467,8 @@ def startSalome(args, modules_list, modules_root_dir):
     # Save Naming service port name into
     # the file args["ns_port_log_file"]
     if args.has_key('ns_port_log_file'):
-      home = os.environ['HOME']
-      appli= os.environ.get("APPLI")
-      if appli is not None:
-        home = os.path.join(os.path.realpath(home), appli, "USERS")
-      file_name = os.path.join(home, args["ns_port_log_file"])
+      omniorbUserPath = os.getenv("OMNIORB_USER_PATH")
+      file_name = os.path.join(omniorbUserPath, args["ns_port_log_file"])
       f = open(file_name, "w")
       f.write(os.environ['NSPORT'])
       f.close()
@@ -608,12 +587,7 @@ def startSalome(args, modules_list, modules_root_dir):
     #
 
     if 'pyContainer' in args['standalone']:
-        myServer=ContainerPYServer(args)
-        myServer.run()
-        if sys.platform == "win32":
-          clt.waitNS("/Containers/" + theComputer + "/FactoryServerPy")
-        else:
-          clt.waitNSPID("/Containers/" + theComputer + "/FactoryServerPy",myServer.PID)
+        raise Exception('Python containers no longer supported')
 
     #
     # Wait until Session Server is registered in naming service
@@ -912,10 +886,9 @@ def foreGround(clt, args):
         killMyPort(port)
         pass
     return
+#
 
-# -----------------------------------------------------------------------------
-
-if __name__ == "__main__":
+def runSalome():
     import user
     clt,args = main()
     # --
@@ -943,3 +916,21 @@ if __name__ == "__main__":
         pass
     # --
     pass
+#
+
+# -----------------------------------------------------------------------------
+
+if __name__ == "__main__":
+
+    ### TEMP ###
+    homePath = os.path.realpath(os.path.expanduser('~'))
+    #defaultOmniorbUserPath = os.path.join(homePath, ".salomeConfig/USERS")
+    appli = os.getenv("APPLI")
+    defaultOmniorbUserPath = homePath
+    if appli:
+        defaultOmniorbUserPath = os.path.join( homePath, appli, "USERS" )
+    os.environ["OMNIORB_USER_PATH"] = defaultOmniorbUserPath
+    ############
+
+    runSalome()
+#