import SALOME__POA
import SALOME
+MY_CONTAINER_ENTRY_IN_GLBS = "my_container"
+
class Generic(SALOME__POA.GenericObj):
"""A Python implementation of the GenericObj CORBA IDL"""
def __init__(self,poa):
linecache.cache[nodeName]=0,None,code.split('\n'),nodeName
ccode=compile(code,nodeName,'exec')
self.context={}
- self.context["my_container"] = self.my_container
+ self.context[MY_CONTAINER_ENTRY_IN_GLBS] = self.my_container
exec(ccode, self.context)
def getContainer(self):
linecache.cache[nodeName]=0,None,code.split('\n'),nodeName
self.ccode=compile(code,nodeName,'exec')
self.context={}
- self.context["my_container"] = self.my_container
+ self.context[MY_CONTAINER_ENTRY_IN_GLBS] = self.my_container
def getContainer(self):
return self.my_container
def listAllVarsInContext(self):
import re
pat = re.compile("^__([a-z]+)__$")
- return [elt for elt in self.context if not pat.match(elt)]
+ return [elt for elt in self.context if not pat.match(elt) and elt != MY_CONTAINER_ENTRY_IN_GLBS]
def removeAllVarsInContext(self):
for elt in self.listAllVarsInContext():