xref: /aosp_15_r20/external/parameter-framework/upstream/bindings/python/README.md (revision c33452fb792a5495ec310a9626f2638b053af5dd)
1*c33452fbSAndroid Build Coastguard Worker# Python bindings
2*c33452fbSAndroid Build Coastguard Worker
3*c33452fbSAndroid Build Coastguard WorkerThese are bindings on the `CParameterMgrFullConnector` class, its inner
4*c33452fbSAndroid Build Coastguard Worker`Ilogger` class and both classes involved in the SelectionCriterion creation.
5*c33452fbSAndroid Build Coastguard Worker
6*c33452fbSAndroid Build Coastguard WorkerThey are complete enough to write a parameter-framework client in Python and
7*c33452fbSAndroid Build Coastguard Workeralso access most of the tuning interface.
8*c33452fbSAndroid Build Coastguard Worker
9*c33452fbSAndroid Build Coastguard Worker## Generation
10*c33452fbSAndroid Build Coastguard Worker
11*c33452fbSAndroid Build Coastguard WorkerThe bindings are defined unsing SWIG in the `pfw.i` file and the actual source
12*c33452fbSAndroid Build Coastguard Workerfiles are generated by the command found in `regen_swig.sh`. This command must
13*c33452fbSAndroid Build Coastguard Workerbe re-run whenever any file in `parameter/include` is modified.
14*c33452fbSAndroid Build Coastguard Worker
15*c33452fbSAndroid Build Coastguard WorkerTwo things are generated:
16*c33452fbSAndroid Build Coastguard Worker
17*c33452fbSAndroid Build Coastguard Worker- A C++ source file providing a low-level wrapping of the parameter-framework
18*c33452fbSAndroid Build Coastguard Worker  classes. When compiled as a shared library, it can be imported from Python as
19*c33452fbSAndroid Build Coastguard Worker  a module called `_PyPfw` but this module is not for direct use.
20*c33452fbSAndroid Build Coastguard Worker- A Python module called `PyPfw`, using `PyPfw`, providing proxy classes of the
21*c33452fbSAndroid Build Coastguard Worker  parameter-framework's native classes. *Please not that in the context of the
22*c33452fbSAndroid Build Coastguard Worker  Python bindings, the `CParameterMgrFullConnector` class is renamed
23*c33452fbSAndroid Build Coastguard Worker  `ParameterFramework`.*
24*c33452fbSAndroid Build Coastguard Worker
25*c33452fbSAndroid Build Coastguard Worker## Usage
26*c33452fbSAndroid Build Coastguard Worker
27*c33452fbSAndroid Build Coastguard Worker`sample.py` provides an example of how to use the PyPfw module. Note that the
28*c33452fbSAndroid Build Coastguard WorkerPYTHONPATH env variable must contain the directory of both `_PyPfw.so` and
29*c33452fbSAndroid Build Coastguard Worker`PyPfw.py`.
30