From 4c92b3931f4abf274305aa47ac931fdef9d307b5 Mon Sep 17 00:00:00 2001 From: rahuel Date: Fri, 5 Nov 2004 07:43:01 +0000 Subject: [PATCH] ContainersManager : Unbind --- src/NamingService/SALOME_NamingServicePy.py | 41 +++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/NamingService/SALOME_NamingServicePy.py b/src/NamingService/SALOME_NamingServicePy.py index 2bc3c553c..25534a390 100644 --- a/src/NamingService/SALOME_NamingServicePy.py +++ b/src/NamingService/SALOME_NamingServicePy.py @@ -195,5 +195,46 @@ class SALOME_NamingServicePy_i: MESSAGE ( "Create_Directory : CORBA.COMM_FAILURE" ) + + #------------------------------------------------------------------------- + def Destroy_Name(self, Path): + MESSAGE ( "SALOME_NamingServicePy_i::Destroy_Name " + Path ) + path_list = list(Path) + if path_list[0]=='/': + self._current_context = self._root_context + #delete first '/' before split + Path=Path[1:] + MESSAGE ( "SALOME_NamingServicePy_i::Destroy_Name " + Path ) + result_resolve_path = split(Path,'/') + context_name=[] + for i in range(len(result_resolve_path)-1): + MESSAGE ( "SALOME_NamingServicePy_i::Destroy_Name result_resolve_path" + str(i) + " " + result_resolve_path[i] ) + context_name.append(CosNaming.NameComponent(result_resolve_path[i],"dir")) + try: + self._obj = self._current_context.resolve( context_name ) + self._current_context = self._obj._narrow(CosNaming.NamingContext) + _context_name=[] + _context_name.append(CosNaming.NameComponent(result_resolve_path[len(result_resolve_path)-1],"object")) + MESSAGE ( "SALOME_NamingServicePy_i::Destroy_Name : unbind " ) + self._current_context.unbind( _context_name ); + except CosNaming.NamingContext.NotFound, ex: + MESSAGE ( "SALOME_NamingServicePy_i::Destroy_Name : CosNaming.NamingContext.NotFound" ) + self._obj = None + except CosNaming.NamingContext.InvalidName, ex: + MESSAGE ( "SALOME_NamingServicePy_i::Destroy_Name : CosNaming.NamingContext.InvalidName" ) + self._obj = None + except CosNaming.NamingContext.CannotProceed, ex: + MESSAGE ( "SALOME_NamingServicePy_i::Destroy_Name : CosNaming.NamingContext.CannotProceed" ) + self._obj = None + except CORBA.COMM_FAILURE, ex: + MESSAGE ( "SALOME_NamingServicePy_i::Destroy_Name : CORBA.COMM_FAILURE" ) + self._obj = None + + + + + + + -- 2.39.2