Salome HOME
updated copyright message
[samples/pycalculator.git] / src / PYCALCULATOR / PYCALCULATOR.py
index d1547dd7f1bd7102b3a73e69f16b1954a372dd45..35058822c19f0364cf44a2cde708078f43fa0dc8 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2023  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
@@ -34,6 +34,7 @@ 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 *
@@ -58,8 +59,13 @@ class PYCALCULATOR(PYCALCULATOR_ORB__POA.PYCALCULATOR_Gen, SALOME_ComponentPy.SA
             instanceName,     # component instance name
             interfaceName,    # component interface name
             False)            # notification flag (for notification server)
-
-        self._naming_service = SALOME_ComponentPy.SALOME_NamingServicePy_i(self._orb)
+        
+        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__")