X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=bin%2FORBConfigFile.py;h=c51187d1d93255ba39ce093c71bef9c592f66d4a;hb=34bdd08c1cbba32e415e32489d56f91cf89e76da;hp=02bdf59a4ba57b199d6c0ec5293b336377b392f8;hpb=42fd71c8d2f6181ff776e87af1cb3dc6636d3de8;p=modules%2Fkernel.git diff --git a/bin/ORBConfigFile.py b/bin/ORBConfigFile.py old mode 100644 new mode 100755 index 02bdf59a4..c51187d1d --- a/bin/ORBConfigFile.py +++ b/bin/ORBConfigFile.py @@ -1,6 +1,6 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE # # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -22,6 +22,23 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +def readORBConfigFile(filename): + """ Extract information (host, port) from ORB configuration file. """ + with open(filename) as f: + contents = f.readlines() + + import re + host, port = None, None + for line in contents: + m = re.match("(ORB)?InitRef = NameService=corbaname::([\D\d]+):(\d*)", line) + if m: + host = m.group(2) + port = m.group(3) + break + pass + return host, port +# + # IMPORTANT NOTE: do not add any print call (cf. note at the bottom of the file) def writeORBConfigFile(path, host, port, kwargs={}): @@ -40,25 +57,28 @@ def writeORBConfigFile(path, host, port, kwargs={}): from omniORB import CORBA prefix = "" if CORBA.ORB_ID == "omniORB4" else "ORB" - GIOP_MaxMsgSize=2097152000 # 2 GBytes + GIOP_MaxMsgSize = 2097152000 # 2 GBytes orbdata = [] orbdata.append("%sInitRef = NameService=corbaname::%s:%s"%(prefix,host,port)) orbdata.append("%sgiopMaxMsgSize = %s # 2 GBytes"%(prefix,GIOP_MaxMsgSize)) orbdata.append("%straceLevel = 0 # critical errors only"%(prefix)) - orbdata.append("%smaxGIOPConnectionPerServer = 50 # to allow containers parallel launch"%(prefix)) + orbdata.append("%smaxGIOPConnectionPerServer = 500 # to allow containers parallel launch"%(prefix)) + orbdata.append("%snativeCharCodeSet = UTF-8"%(prefix)) orbdata.append("") - f = open(omniorb_config, "w") - f.write("\n".join(orbdata)) - f.close() + with open(omniorb_config, "w") as f: + f.write("\n".join(orbdata)) return [ omniorb_config, GIOP_MaxMsgSize ] # ----------------------------------------------------------------------------- if __name__ == "__main__": - import sys, getopt + import sys + + if len(sys.argv) < 2: + sys.exit(-1) path = sys.argv[1] host = sys.argv[2] @@ -82,4 +102,4 @@ if __name__ == "__main__": # RETURN_VALUE_2=$(echo ${RETURN_VALUES} | cut -d' ' -f2) # ... # IMPORTANT NOTE: this print call MUST BE the first one!! - print filename, msgSize + print(filename, msgSize)