Salome HOME
Merge from BR_KERNEL_REFACTORING
[modules/kernel.git] / doc / docutils / overview.rst
1
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 General presentation of the KERNEL python package
4 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5
6 The KERNEL python package essentially contains:
7
8 * Helper functions to manipulate KERNEL objects from python. For
9   example, the ``studyedit.py`` module facilitates the
10   manipulation of components and items in SALOME study.
11 * General purpose functions for logging and other recurrent
12   stuff in python programming.
13
14 Note that these functions either encapsulate the python programming
15 interface of KERNEL core (the CORBA or SWIG interfaces for example) or
16 extend existing utilities as the ``salome*.py`` modules.
17
18 The functions are distributed in the python package
19 ``salome.kernel``. For example, the usage of the study editor to
20 manipulate some objects can be done with a set of instructions as:
21
22 .. code-block:: python
23  
24  from salome.kernel.studyedit import getStudyEditor
25
26  studyEditor = getStudyEditor()  # Get an editor for the current study
27  
28  myStudyComponent = studyEditor.findOrCreateComponent(
29         moduleName,
30         componentName,
31         componentIcon)
32
33  myStudyItem = studyEditor.createItem(
34         myStudyComponent,
35         itemName,
36         comment = itemComment,
37         icon = itemIcon)
38
39 The specification of the programming interface of this package is
40 detailed in the part :doc:`Documentation of the programming interface
41 (API)</docapi>` of this documentation.
42
43 .. note::
44    The main package ``salome`` contains other sub-packages that are
45    distributed with the other SALOME modules. For example, the GEOM
46    module provides the python package ``salome.geom`` and SMESH the
47    package ``salome.smesh``.