On 13/07/13 23:57, Christian Boltz wrote:
Hello,
Am Freitag, 12. Juli 2013 schrieb Josef Reidinger:
at first congratulation to look at our python bindings. I expect that you see there a lot of sharp edges. In fact, now there is no maintainer for python bindings, so if you want to take care of it, I would welcome it. I can help you with understanding how it works from liby2 side ( y2 is component system to which is bindings attached ).
I know YaST2 mostly from a user's POV (and nearly nothing about its libraries and bindings), but nevertheless I'd like to ask a (maybe silly) question ;-)
For libapparmor, we are using swig to auto-generate the python (and other) bindings. This works with very few lines of code.
In comparison, the code for the YaST python bindings is quite big, which also means more maintenance is required.
SWIG is meant to bind C/C++ code. YaST bindings are a multilanguage
hub/broker.
YaST bindings are more of bindings against the YCP type system, for
example with the perl, ruby and python bindings you can write code in
perl, ruby or python that call functions implemented in perl, ruby,
python, the ycp language or plain c++.
A SWIG binding scans a .h file and generates the interpreter glue code
for that API.
There is no static API for YaST bindings. They are found at runtime
scanning installed YaST modules in any language.
Workflow is like this (simplified, it is actually a bit more sophisticated):