Salome HOME
Updated copyright comment
[samples/pycalculator.git] / src / PYCALCULATOR / PYCALCULATOR.py
old mode 100755 (executable)
new mode 100644 (file)
index 369fc2a..99c70d8
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2016  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 *
@@ -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__")