-# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
# This is necessary to ensure that different modules will have the same definition
# of dynamic types and C++ RTTI will work between them
#
-import DLFCN, sys
-sys.setdlopenflags(DLFCN.RTLD_NOW | DLFCN.RTLD_GLOBAL)
+import os, sys
+sys.setdlopenflags(os.RTLD_NOW | os.RTLD_GLOBAL)
import PYCALCULATOR_ORB__POA
import SALOME_ComponentPy
+import SALOME_Embedded_NamingService_ClientPy
import SALOME_MED
from MEDCouplingClient import *
def __init__(self, orb, poa, contID, containerName, instanceName,
interfaceName):
- if verbose(): print "Begin of PYCALCULATOR::__init__"
+ if verbose(): print("Begin of PYCALCULATOR::__init__")
SALOME_ComponentPy.SALOME_ComponentPy_i.__init__(
self,
containerName, # SALOME container name
instanceName, # component instance name
interfaceName, # component interface name
- 0) # notification flag (for notification server)
-
- self._naming_service = SALOME_ComponentPy.SALOME_NamingServicePy_i(self._orb)
+ False) # notification flag (for notification server)
+
+ emb_ns = self._contId.get_embedded_NS_if_ssl()
+ import CORBA
+ if CORBA.is_nil(emb_ns):
+ self._naming_service = SALOME_ComponentPy.SALOME_NamingServicePy_i( self._orb )
+ else:
+ self._naming_service = SALOME_Embedded_NamingService_ClientPy.SALOME_Embedded_NamingService_ClientPy(emb_ns)
- if verbose(): print "End of PYCALCULATOR::__init__"
+ if verbose(): print("End of PYCALCULATOR::__init__")
pass
self.beginService("PYCALCULATOR::Clone")
if verbose():
- print "Begin of PYCALCULATOR::Clone"
- print " field : ", field
+ print("Begin of PYCALCULATOR::Clone")
+ print(" field : ", field)
pass
frescorba = None
# create CORBA field
frescorba = MEDCouplingFieldDoubleServant._this(f)
- except Exception, e:
- if verbose(): print e
+ except Exception as e:
+ if verbose(): print(e)
pass
if verbose():
- print "End of PYCALCULATOR::Clone"
+ print("End of PYCALCULATOR::Clone")
pass
self.endService("PYCALCULATOR::Clone")
self.beginService("PYCALCULATOR::Add")
if verbose():
- print "Begin of PYCALCULATOR::Add"
- print " field 1 : ", field1
- print " field 2 : ", field2
+ print("Begin of PYCALCULATOR::Add")
+ print(" field 1 : ", field1)
+ print(" field 2 : ", field2)
pass
frescorba = None
# create CORBA field
frescorba = MEDCouplingFieldDoubleServant._this(fres)
- except Exception, e:
- if verbose(): print e
+ except Exception as e:
+ if verbose(): print(e)
pass
if verbose():
- print "End of PYCALCULATOR::Add"
+ print("End of PYCALCULATOR::Add")
pass
self.endService("PYCALCULATOR::Add")
self.beginService("PYCALCULATOR::Mul")
if verbose():
- print "Begin of PYCALCULATOR::Mul"
- print " field 1 : ", field1
- print " field 2 : ", field2
+ print("Begin of PYCALCULATOR::Mul")
+ print(" field 1 : ", field1)
+ print(" field 2 : ", field2)
pass
frescorba = None
# create CORBA field
frescorba = MEDCouplingFieldDoubleServant._this(fres)
- except Exception, e:
- if verbose(): print e
+ except Exception as e:
+ if verbose(): print(e)
pass
if verbose():
- print "End of PYCALCULATOR::Mul"
+ print("End of PYCALCULATOR::Mul")
pass
self.endService("PYCALCULATOR::Mul")
self.beginService("PYCALCULATOR::AddConstant")
if verbose():
- print "Begin of PYCALCULATOR::AddConstant"
- print " field : ", field
- print " constant : ", val
+ print("Begin of PYCALCULATOR::AddConstant")
+ print(" field : ", field)
+ print(" constant : ", val)
pass
frescorba = None
# create CORBA field
frescorba = MEDCouplingFieldDoubleServant._this(fres)
- except Exception, e:
- if verbose(): print e
+ except Exception as e:
+ if verbose(): print(e)
pass
if verbose():
- print "End of PYCALCULATOR::AddConstant"
+ print("End of PYCALCULATOR::AddConstant")
pass
self.endService("PYCALCULATOR::AddConstant")
self.beginService("PYCALCULATOR::MulConstant")
if verbose():
- print "Begin of PYCALCULATOR::MulConstant"
- print " field : ", field
- print " constant : ", val
+ print("Begin of PYCALCULATOR::MulConstant")
+ print(" field : ", field)
+ print(" constant : ", val)
pass
frescorba = None
# create CORBA field
frescorba = MEDCouplingFieldDoubleServant._this(fres)
- except Exception, e:
- if verbose(): print e
+ except Exception as e:
+ if verbose(): print(e)
pass
if verbose():
- print "End of PYCALCULATOR::MulConstant"
+ print("End of PYCALCULATOR::MulConstant")
pass
self.endService("PYCALCULATOR::MulConstant")