From 01f9656f7b3409c467168369be90ff9876f487fe Mon Sep 17 00:00:00 2001 From: abd Date: Mon, 23 Oct 2006 07:00:49 +0000 Subject: [PATCH] Runnig without omniNames console --- bin/orbmodule.py | 37 +++++-------------------------------- bin/runNS.py | 7 ++++--- bin/runSalome.py | 40 +++------------------------------------- 3 files changed, 12 insertions(+), 72 deletions(-) diff --git a/bin/orbmodule.py b/bin/orbmodule.py index 04fc90e66..02cef5f74 100755 --- a/bin/orbmodule.py +++ b/bin/orbmodule.py @@ -18,55 +18,28 @@ # 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 diff --git a/bin/runNS.py b/bin/runNS.py index ff25c6321..22c5fb120 100755 --- a/bin/runNS.py +++ b/bin/runNS.py @@ -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 + " &") diff --git a/bin/runSalome.py b/bin/runSalome.py index c8731e95c..d35b96b3e 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -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 -- 2.39.2