2 \page KERNEL_Services KERNEL Services for end user (Python interface)
4 <b>WORK in PROGRESS, INCOMPLETE DOCUMENT</b>
6 In a %SALOME application, distributed components, servers and clients use
7 the CORBA middleware for comunication. CORBA interfaces are defined via idl
8 files. All the different CORBA interfaces are available for users in Python,
9 see CORBA interfaces below.
11 For some general purpose services, CORBA interfaces have been encapsulated
12 in order to provide a simple interface (encapsulation is generally done in
13 C++ classes, and a Python SWIG interface is also generated from C++, to
14 ensure a consistent behavior between C++ modules and Python modules or user
17 \section S1_kernel_ser General purpose services
21 <b>%SALOME services access from a Python shell</b>
23 See \ref SALOME_Application for detailed instructions to launch a Python
24 interpreter with full acces to the %SALOME environment and services.
26 You can use the embedded Python interpreter in Grahic User Interface, or an
27 external interpreter, with:
34 In either cases, %SALOME services access is done with:
41 In the embedded interpreter, it is already done, but there is no problem to
42 do it several times, so it is preferable to add these instructions
43 systematically in your scripts, to allow them to work in all configurations.
47 <b>Container and component instanciation</b>
49 See LifeCycleCORBA for the C++ interface (Python interface obtained with SWIG
52 In the following example, a test component provided in KERNEL is launched
53 in the local container, "FactoryServer", created when %SALOME starts:
60 lcc = LifeCycleCORBA.LifeCycleCORBA()
61 obj=lcc.FindOrLoad_Component("FactoryServer","SalomeTestComponent")
64 comp=obj._narrow(Engines.TestComponent)
69 The answer is something like:
72 'TestComponent_i : L = 1'
75 The _narrow() instruction is not always mandatory in Python, but sometimes
76 useful to be sure you have got the right type of %object. Here, Testcomponent
77 interface is defined in CORBA module Engines. With this example, it works also
78 without the _narrow() instruction:
84 In the next example, a component instance is created in a specific Container
85 defined by it's computer hostname and it's name. Here we use the local
86 computer. Note that in Utils_Identity, getShortHostName() gives the short
87 hostname of the computer, without domain suffixes, which is used in %SALOME.
88 The container process is created here if it does not exists, and a new
89 component instance is created:
95 lcc = LifeCycleCORBA.LifeCycleCORBA()
98 host = Utils_Identity.getShortHostName()
102 params['hostname']=host
103 params['container_name']='myContainer'
104 comp=lcc.LoadComponent(params,'SalomeTestComponent')
108 If you want to get a list of containers and component instances, client %object
109 from orbmodule provides a list:
113 clt=orbmodule.client()
121 ContainerManager.object
124 FactoryServerPy.object
125 SuperVisionContainer.object
128 SalomeTestComponent_inst_1.object
131 SalomeTestComponent_inst_1.object
132 SalomeTestComponent_inst_2.object
142 myStudyManager.object
143 SalomeAppEngine.object
148 <b>File transfer service</b>
150 See SALOME_FileTransferCORBA for the C++ interface (Python interface obtained with
151 SWIG is very similar).
153 The following example shows how to tranfer a file from a remote host to the
154 client computer. Remote hostname is 'cli76cc', we would like to copy
155 'tkcvs_8_0_3.tar.gz' from remote to local computer. %A full pathname is
156 required. %A container is created on remote computer if it does not exist,
157 to handle the file transfer:
163 import LifeCycleCORBA
164 remotefile="/home/prascle/tkcvs_8_0_3.tar.gz"
165 aFileTransfer=LifeCycleCORBA.SALOME_FileTransferCORBA('cli76cc',remotefile)
166 localFile=aFileTransfer.getLocalFile()
171 <b>CORBA Naming service access</b>
173 See SALOME_NamingService for the C++ interface. The Python interface
174 SALOME_NamingServicePy is not yet derived from the C++ interface and offers
175 only the most useful functions.
179 <b>Batch services</b>
181 See \ref batch_page documentation (in french only).
186 \section S2_kernel_ser All IDL Interfaces
190 <b>Containers and component life cycle, File transfer service</b>
192 - Engines : engines CORBA module.
193 - Engines::Component : generic component interface. All %SALOME components inherit this interface.
194 - Engines::Container : host for C++ and Python components components instances
195 - Engines::fileTransfer : agent for file transfer created by a container copy a local file to a distent client
196 - Engines::fileRef : reference to a file, used by a container for file transfers
197 - Engines::ContainerManager : unique instance, in charge of container creation on remote computers
198 - Engines::MPIContainer : an exemple of parallel implementation for containers and components
203 <b>Study management</b>
205 - SALOMEDS : SALOMEDS CORBA module
207 - SALOMEDS_Attributes.idl
211 <b>High speed transfer, object life cycle, exceptions, GUI interface...</b>
213 - SALOME : %SALOME CORBA module
215 - SALOME_GenericObj.idl
223 - SALOME_ModuleCatalog
224 - SALOME_RessourcesCatalog
225 - SALOME_Registry.idl
228 <b>Other idl for test purposes</b>
231 - SALOME_TestComponent.idl
232 - SALOME_TestModuleCatalog.idl
233 - SALOME_TestMPIComponent.idl