From 7184627b5609f3c79e15d5eac71debed643bb8e9 Mon Sep 17 00:00:00 2001 From: ribes Date: Wed, 10 Nov 2010 15:19:44 +0000 Subject: [PATCH] Bug Fix: PyNodes need to get a reference to its container on remote mode --- src/Container/SALOME_Container.py | 2 +- src/Container/SALOME_PyNode.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Container/SALOME_Container.py b/src/Container/SALOME_Container.py index d3dfc6482..c830f8d96 100644 --- a/src/Container/SALOME_Container.py +++ b/src/Container/SALOME_Container.py @@ -128,7 +128,7 @@ class SALOME_Container_i: def create_pynode(self,nodeName,code): try: - node=SALOME_PyNode.PyNode_i(nodeName,code,self._poa) + node=SALOME_PyNode.PyNode_i(nodeName,code,self._poa,self) id_o = self._poa.activate_object(node) comp_o = self._poa.id_to_reference(id_o) comp_iors = self._orb.object_to_string(comp_o) diff --git a/src/Container/SALOME_PyNode.py b/src/Container/SALOME_PyNode.py index f02d54f36..cf50f8ca6 100644 --- a/src/Container/SALOME_PyNode.py +++ b/src/Container/SALOME_PyNode.py @@ -48,14 +48,16 @@ class Generic(SALOME__POA.GenericObj): class PyNode_i (Engines__POA.PyNode,Generic): """The implementation of the PyNode CORBA IDL""" - def __init__(self, nodeName,code,poa): + def __init__(self, nodeName,code,poa,my_container): """Initialize the node : compilation in the local context""" Generic.__init__(self,poa) self.nodeName=nodeName self.code=code + self.my_container=my_container._container linecache.cache[nodeName]=0,None,string.split(code,'\n'),nodeName ccode=compile(code,nodeName,'exec') self.context={} + self.context["my_container"] = self.my_container exec ccode in self.context def execute(self,funcName,argsin): -- 2.39.2