Salome HOME
Correction of bug for HPContainers shared by different scripts.
[modules/kernel.git] / bin / runSalome.py
index 99b7d18f5d2e725226619c35b930f75797f8c0bc..c819b857c8513c044d2a650d8e4e63e69cbf26d6 100755 (executable)
@@ -393,21 +393,6 @@ class LauncherServer(Server):
             self.CMD=self.SCMD1 + ['"' + string.join(cata_path,'"::"') + '"'] + self.SCMD2
         else:
             self.CMD=self.SCMD1 + self.SCMD2
-
-class NotifyServer(Server):
-    def __init__(self,args,modules_root_dir):
-        self.args=args
-        self.initArgs()
-        self.modules_root_dir=modules_root_dir
-        myLogName = os.environ["LOGNAME"]
-        self.CMD=['notifd','-c',
-                  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',
-                  '-DDebugLogFile=/tmp/'+myLogName+'_notifd.debug',
-                  ]
-
 #
 # -----------------------------------------------------------------------------
 
@@ -500,15 +485,6 @@ def startSalome(args, modules_list, modules_root_dir):
         myServer.run()
         clt.waitLogger("Logger")
 
-    # Notify Server launch
-    #
-
-    if sys.platform != "win32":
-      if verbose(): print "Notify Server to launch"
-
-      myServer=NotifyServer(args,modules_root_dir)
-      myServer.run()
-
     # set siman python path before the session server launching to import scripts inside python console
     if simanStudyName(args):
         # MPV: use os.environ here because session server is launched in separated process and sys.path is missed in this case
@@ -749,11 +725,14 @@ def useSalome(args, modules_list, modules_root_dir):
                         import killSalomeWithPort
                         self.killSalomeWithPort = killSalomeWithPort
                         return
-                    def delete(self):
+                    def __del__(self):
                         self.killSalomeWithPort.killMyPort(self.port)
                         return
                     pass
-                args['shutdown_servers'] = __utils__(args['port'])
+                def func(s):
+                    del s
+                import atexit
+                atexit.register(func, __utils__(args['port']))
                 pass
             pass
 
@@ -764,7 +743,7 @@ def useSalome(args, modules_list, modules_root_dir):
                 if not args['gui'] or not args['session_gui']:
                     toimport = args['pyscript']
 
-        from salomeLauncherUtils import formatScriptsAndArgs
+        from salomeContextUtils import formatScriptsAndArgs
         command = formatScriptsAndArgs(toimport)
         if command:
             proc = subprocess.Popen(command, shell=True)
@@ -811,11 +790,6 @@ def no_main():
     from searchFreePort import searchFreePort
     searchFreePort(args, 0)
     clt = useSalome(args, modules_list, modules_root_dir)
-
-    if args.has_key('shutdown_servers') : 
-        var = args['shutdown_servers']
-        if hasattr(var, 'delete') and callable(getattr(var, 'delete')) : 
-            var.delete()
     return clt
 
 # -----------------------------------------------------------------------------
@@ -825,7 +799,7 @@ def main():
 
     # define folder to store omniorb config (initially in virtual application folder)
     try:
-        from salomeLauncherUtils import setOmniOrbUserPath
+        from salomeContextUtils import setOmniOrbUserPath
         setOmniOrbUserPath()
     except Exception, e:
         print e
@@ -943,11 +917,6 @@ def runSalome():
     if test:
         foreGround(clt, args)
         pass
-    # --
-    if args.has_key('shutdown_servers') : 
-        var = args['shutdown_servers']
-        if hasattr(var, 'delete') and callable(getattr(var, 'delete')) : 
-            var.delete()
     pass
 #