]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Runnig without omniNames console
authorabd <abd@opencascade.com>
Mon, 23 Oct 2006 07:00:49 +0000 (07:00 +0000)
committerabd <abd@opencascade.com>
Mon, 23 Oct 2006 07:00:49 +0000 (07:00 +0000)
bin/orbmodule.py
bin/runNS.py
bin/runSalome.py

index 04fc90e66b854f6603d9132ca71177308cca765b..02cef5f74b9b721807f99fa52e9626b6e1d4b8da 100755 (executable)
 # 
 import sys,os,time
 import string
+from nameserver import *
 from omniORB import CORBA
 
 # Import the stubs for the Naming service
 import CosNaming
 from runNS import *
 
-# -----------------------------------------------------------------------------
-
-class Server:
-   XTERM="/usr/bin/X11/xterm -iconic -e "
-   CMD=""
-
-   def run(self):
-       commande=self.XTERM+self.CMD
-       print commande
-       if sys.platform != "win32":
-         ier=os.system(commande)
-         if ier:
-           print "Commande failed"
-
-# -----------------------------------------------------------------------------
-
-class NamingServer(Server):
-   XTERM=""
-   USER=os.getenv('USER')
-   if USER is None:
-      USER='anonymous'
-   #os.system("mkdir -m 777 -p /tmp/logs")
-   #LOGDIR="/tmp/logs/" + USER
-   #os.system("mkdir -m 777 -p " + LOGDIR)
-   #CMD="runNS.sh > " + LOGDIR + "/salomeNS.log 2>&1"
-   startOmni()
-   
-
 # -----------------------------------------------------------------------------
 
 class client:
 
-   def __init__(self):
+   def __init__(self,args):
       #set GIOP message size for bug 10560: impossible to get field values in TUI mode
       sys.argv.extend(["-ORBgiopMaxMsgSize", "104857600"]) ## = 100 * 1024 * 1024
       # Initialise the ORB
       self.orb=CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
       # Initialise the Naming Service
-      self.initNS()
+      self.initNS(args)
 
    # --------------------------------------------------------------------------
 
-   def initNS(self):
+   def initNS(self,args):
       # Obtain a reference to the root naming context
       obj         = self.orb.resolve_initial_references("NameService")
       try:
@@ -77,7 +50,7 @@ class client:
           print "Lancement du Naming Service",
           
       # On lance le Naming Server (doit etre dans le PATH)
-      NamingServer().run()
+      NamingServer(args).run()
       print "Searching Naming Service ",
       ncount=0
       delta=0.1
index ff25c6321903aeedcebe59e7eebd615d2290024d..22c5fb1206fd730f27103accd4f79fe41be918bf 100755 (executable)
@@ -66,10 +66,11 @@ def startOmni():
        if sys.platform == "win32":          
           #import win32pm
           #command = ['omniNames -start ' , aPort , ' -logdir ' , '\"' + upath + '\"']
-          os.system("start omniNames -start " + aPort + " -logdir " + "\"" + upath + "\"" )
+          #os.system("start omniNames -start " + aPort + " -logdir " + "\"" + upath + "\"" )
+          command = "start omniNames -start " + aPort + " -logdir " + "\"" + upath + "\""
           #print command
-          #pid = win32pm.spawnpid( string.join(command, " ") )
-          #process_id[pid]=command
+          pid = win32pm.spawnpid( string.join(command, " "), -nc )
+          process_id[pid]=command
        else:
          os.system("omniNames -start " + aPort + " -logdir " + upath + " &")
 
index c8731e95ce2ea41666b42a3dbe663f16989cab11..d35b96b3e566c35b1daf0a997632e120341932b6 100755 (executable)
@@ -22,8 +22,8 @@
 import sys, os, string, glob, time, pickle
 import orbmodule
 import setenv
-
-process_id = {}
+from server import *
+#process_id = {} move to server.py
 
 # -----------------------------------------------------------------------------
 
@@ -76,40 +76,6 @@ def kill_salome(args):
 # Definition des classes d'objets pour le lancement des Server CORBA
 #
 
-class Server:
-    """Generic class for CORBA server launch"""
-
-    def initArgs(self):
-        self.PID=None
-        self.CMD=[]
-        self.ARGS=[]   
-        if self.args['xterm']:
-            self.ARGS=['xterm', '-iconic', '-sb', '-sl', '500', '-hold']
-
-    def __init__(self,args):
-        self.args=args
-        self.initArgs()
-
-
-    def run(self):
-        global process_id
-        myargs=self.ARGS
-        if self.args['xterm']:
-            # (Debian) send LD_LIBRARY_PATH to children shells (xterm)
-            env_ld_library_path=['env', 'LD_LIBRARY_PATH='
-                                 + os.getenv("LD_LIBRARY_PATH")]
-            myargs = myargs +['-T']+self.CMD[:1]+['-e'] + env_ld_library_path
-        command = myargs + self.CMD
-        print "SERVER::command = ", command
-       if sys.platform == "win32":
-         import win32pm
-          pid = win32pm.spawnpid( string.join(command, " "),'-nc' )
-       else:
-          pid = os.spawnvp(os.P_NOWAIT, command[0], command)
-        process_id[pid]=self.CMD
-        self.PID = pid
-       
-
 class InterpServer(Server):
     def __init__(self,args):
         self.args=args
@@ -405,7 +371,7 @@ def startSalome(args, modules_list, modules_root_dir):
     # Initialisation ORB et Naming Service
     #
    
-    clt=orbmodule.client()
+    clt=orbmodule.client(args)
 
     # (non obligatoire) Lancement Logger Server
     # et attente de sa disponibilite dans le naming service