From a95bc8fee97225513cb10a18600084ad1e637dc0 Mon Sep 17 00:00:00 2001 From: prascle Date: Wed, 4 Jun 2008 16:48:43 +0000 Subject: [PATCH] PR: use of verbose test for Python prints --- bin/nameserver.py | 13 +++++++------ bin/orbmodule.py | 3 ++- bin/runSalome.py | 4 +--- src/Container/SALOME_ContainerPy.py | 6 +++--- src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/bin/nameserver.py b/bin/nameserver.py index dd03c51a3..04b3134bc 100755 --- a/bin/nameserver.py +++ b/bin/nameserver.py @@ -4,6 +4,7 @@ import sys, os, re, socket #import commands from server import * from Utils_Identity import getShortHostName +from launchConfigureParser import verbose # ----------------------------------------------------------------------------- @@ -50,7 +51,7 @@ class NamingServer(Server): pass #os.system("rm -f " + upath + "/omninames* " + upath + "/dummy " + upath + "/*.log") - print "Name Service... ", + if verbose(): print "Name Service... ", #hname=os.environ["HOST"] #commands.getoutput("hostname") if sys.platform == "win32": hname=getShortHostName(); @@ -60,7 +61,7 @@ class NamingServer(Server): f=open(os.environ["OMNIORB_CONFIG"]) ss=re.findall("NameService=corbaname::" + hname + ":\d+", f.read()) - print "ss = ", ss, + if verbose(): print "ss = ", ss, f.close() sl=ss[0] ll = sl.split(':') @@ -74,15 +75,15 @@ class NamingServer(Server): #print "port=", aPort if sys.platform == "win32": #print "start omniNames -start " + aPort + " -logdir " + upath - self.CMD=['omniNames -start ' , aPort , ' -logdir ' , '\"' + upath + '\"'] + self.CMD=['omniNames -start ' , aPort , ' -logdir ' , '\"' + upath + '\"', ' -errlog', 'omniNameErrors.log'] #os.system("start omniNames -start " + aPort + " -logdir " + upath) else: #self.CMD=['omniNames -start ' , aPort , ' -logdir ' , upath , ' &'] - self.CMD=['omniNames','-start' , aPort, '-logdir' , upath ] + self.CMD=['omniNames','-start' , aPort, '-logdir' , upath, '-errlog', 'omniNameErrors.log'] #os.system("omniNames -start " + aPort + " -logdir " + upath + " &") - print "... ok" - print "to list contexts and objects bound into the context with the specified name : showNS " + if verbose(): print "... ok" + if verbose(): print "to list contexts and objects bound into the context with the specified name : showNS " def initArgs(self): diff --git a/bin/orbmodule.py b/bin/orbmodule.py index 9f3c66324..ffb211fab 100755 --- a/bin/orbmodule.py +++ b/bin/orbmodule.py @@ -20,6 +20,7 @@ import sys,os,time import string from nameserver import * from omniORB import CORBA +from launchConfigureParser import verbose # Import the stubs for the Naming service import CosNaming @@ -47,7 +48,7 @@ class client: return except (CORBA.TRANSIENT,CORBA.OBJECT_NOT_EXIST,CORBA.COMM_FAILURE): self.rootContext = None - print "Launch Naming Service++", + if verbose(): print "Launch Naming Service++", # On lance le Naming Server (doit etre dans le PATH) NamingServer(args).run() diff --git a/bin/runSalome.py b/bin/runSalome.py index dc256253e..254e121a8 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -418,10 +418,8 @@ def startSalome(args, modules_list, modules_root_dir): # Notify Server launch # - if verbose(): print "Notify Server to launch" - if sys.platform != "win32": - print "Notify Server to launch" + if verbose(): print "Notify Server to launch" myServer=NotifyServer(args,modules_root_dir) myServer.run() diff --git a/src/Container/SALOME_ContainerPy.py b/src/Container/SALOME_ContainerPy.py index db23b6c79..4eac58a65 100755 --- a/src/Container/SALOME_ContainerPy.py +++ b/src/Container/SALOME_ContainerPy.py @@ -320,16 +320,16 @@ class SALOME_ContainerPy_i (Engines__POA.Container): print "Starting ",sys.argv[1] orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID) poa = orb.resolve_initial_references("RootPOA") -print "ORB and POA initialized" +if verbose(): print "ORB and POA initialized" #create an instance of SALOME_ContainerPy_i and a Container reference #containerName = "FactoryServerPy" MESSAGE( str(sys.argv) ) containerName = sys.argv[1] cpy_i = SALOME_ContainerPy_i(orb, poa, containerName) -print "SALOME_ContainerPy_i instance created ",cpy_i +if verbose(): print "SALOME_ContainerPy_i instance created ",cpy_i cpy_o = cpy_i._this() -print "SALOME_ContainerPy_i instance activated ",cpy_o +if verbose(): print "SALOME_ContainerPy_i instance activated ",cpy_o sys.stdout.flush() sys.stderr.flush() diff --git a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx index 87c1f80a9..efb997978 100644 --- a/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx +++ b/src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx @@ -36,9 +36,9 @@ using namespace std; #include "utilities.h" #ifdef _DEBUG_ -static int MYDEBUG = 1; +static int MYDEBUG = 0; #else -static int MYDEBUG = 1; +static int MYDEBUG = 0; #endif static const char* SEPARATOR = "::"; -- 2.39.2