Back to index

salome-kernel  6.5.0
Public Member Functions | Private Attributes | Static Private Attributes
SALOME_Container.SALOME_Container_i Class Reference
Collaboration diagram for SALOME_Container.SALOME_Container_i:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def import_component
def create_component_instance
def create_pynode
def create_pyscriptnode

Private Attributes

 _containerName
 _container

Static Private Attributes

 _orb = None
 _poa = None
string _containerName = ""
 _naming_service = None

Detailed Description

Definition at line 55 of file SALOME_Container.py.


Constructor & Destructor Documentation

def SALOME_Container.SALOME_Container_i.__init__ (   self,
  containerName,
  containerIORStr 
)

Definition at line 63 of file SALOME_Container.py.

00063 
00064     def __init__(self ,containerName, containerIORStr):
00065         MESSAGE( "SALOME_Container_i::__init__" )
00066         self._orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
00067         self._poa = self._orb.resolve_initial_references("RootPOA")
00068         self._containerName = containerName
00069         if verbose(): print "SALOME_Container.SALOME_Container_i : _containerName ",self._containerName
00070         #self._naming_service = SALOME_NamingServicePy_i(self._orb)
00071         self._container = self._orb.string_to_object(containerIORStr)


Member Function Documentation

def SALOME_Container.SALOME_Container_i.create_component_instance (   self,
  componentName,
  instanceName,
  studyId 
)

Definition at line 105 of file SALOME_Container.py.

00105 
00106     def create_component_instance(self, componentName, instanceName, studyId):
00107         MESSAGE( "SALOME_Container_i::create_component_instance" )
00108         comp_iors=""
00109         ret=""
00110         try:
00111             component=__import__(componentName)
00112             factory=getattr(component,componentName)
00113             comp_i=factory(self._orb,
00114                            self._poa,
00115                            self._container,
00116                            self._containerName,
00117                            instanceName,
00118                            componentName)
00119 
00120             MESSAGE( "SALOME_Container_i::create_component_instance : OK")
00121             comp_o = comp_i._this()
00122             comp_iors = self._orb.object_to_string(comp_o)
00123         except:
00124             ret=traceback.format_exc(10)
00125             traceback.print_exc()
00126             MESSAGE( "SALOME_Container_i::create_component_instance : NOT OK")
00127         return comp_iors, ret
00128         

Here is the caller graph for this function:

def SALOME_Container.SALOME_Container_i.create_pynode (   self,
  nodeName,
  code 
)

Definition at line 129 of file SALOME_Container.py.

00129 
00130     def create_pynode(self,nodeName,code):
00131         try:
00132           node=SALOME_PyNode.PyNode_i(nodeName,code,self._poa,self)
00133           id_o = self._poa.activate_object(node)
00134           comp_o = self._poa.id_to_reference(id_o)
00135           comp_iors = self._orb.object_to_string(comp_o)
00136           return 0,comp_iors
00137         except:
00138           exc_typ,exc_val,exc_fr=sys.exc_info()
00139           l=traceback.format_exception(exc_typ,exc_val,exc_fr)
00140           return 1,"".join(l)

def SALOME_Container.SALOME_Container_i.create_pyscriptnode (   self,
  nodeName,
  code 
)

Definition at line 141 of file SALOME_Container.py.

00141 
00142     def create_pyscriptnode(self,nodeName,code):
00143         try:
00144           node=SALOME_PyNode.PyScriptNode_i(nodeName,code,self._poa,self)
00145           id_o = self._poa.activate_object(node)
00146           comp_o = self._poa.id_to_reference(id_o)
00147           comp_iors = self._orb.object_to_string(comp_o)
00148           return 0,comp_iors
00149         except:
00150           exc_typ,exc_val,exc_fr=sys.exc_info()
00151           l=traceback.format_exception(exc_typ,exc_val,exc_fr)
00152           return 1,"".join(l)
def SALOME_Container.SALOME_Container_i.import_component (   self,
  componentName 
)

Definition at line 74 of file SALOME_Container.py.

00074 
00075     def import_component(self, componentName):
00076         MESSAGE( "SALOME_Container_i::import_component" )
00077         ret=""
00078         try:
00079             if verbose(): print "try import ",componentName
00080             __import__(componentName)
00081             if verbose(): print "import ",componentName," successful"
00082         except ImportError,e:
00083             #can't import python module componentName
00084             #try to find it in python path
00085             try:
00086               fp, pathname, description = imp.find_module(componentName)
00087               if fp:fp.close()
00088               #module file found in path
00089               ret="Component "+componentName+": Python implementation found but it can't be loaded\n"
00090               ret=ret+traceback.format_exc(10)
00091             except ImportError,ee:
00092               ret="ImplementationNotFound"
00093             except:
00094               if verbose():print "error when calling find_module"
00095               ret="ImplementationNotFound"
00096         except:
00097             ret="Component "+componentName+": Python implementation found but it can't be loaded\n"
00098             ret=ret+traceback.format_exc(10)
00099             if verbose():
00100               traceback.print_exc()
00101               print "import ",componentName," not possible"
00102         return ret
        

Here is the caller graph for this function:


Member Data Documentation

Definition at line 70 of file SALOME_Container.py.

Definition at line 58 of file SALOME_Container.py.

Definition at line 67 of file SALOME_Container.py.

Definition at line 59 of file SALOME_Container.py.

SALOME_Container.SALOME_Container_i._orb = None [static, private]

Definition at line 56 of file SALOME_Container.py.

SALOME_Container.SALOME_Container_i._poa = None [static, private]

Definition at line 57 of file SALOME_Container.py.


The documentation for this class was generated from the following file: