[yast-devel] YaST bindings for Python3?
Hello everyone, I am Kshitij and I'm working on Profile Tools for AppArmor using Python3 under Google Summer of Code'13. This may have been asked before, but I tried searching on the net and asking on the IRC channel too but could not find an answer. The present tools (in Perl) have a YaST interface besides the CLI, as I'm re-writing them in Python3 (Python 3.3 to be precise) and a few additional tools I also have to interface with YaST. I was able to find yast2-bindings for python but they are for Python2.7, but not for Python3. I would be very grateful if somebody can help me in this regard. Regards, Kshitij Gupta -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
Hello,
I spent some trying to figure out a way to port the bindings to Python3.
I patched some config files (which I forked from cboltz's branch) to
build the bindings with Python3. Then I realised that the C++ code
needs to be modified too to match the Python3 C API. I found the
following site, which guides on migrating code to Python:
http://python3porting.com/cextensions.html
Maybe somebody more familiar with the code-base can make the code
compatible with both Python2 and 3 with some effort.
Hope that might be helpful.
My branch:
https://build.opensuse.org/package/show/home:kshitij8:branches:YaST:Head/yas...
cboltz's branch:
https://build.opensuse.org/package/show/home:cboltz:branches:YaST:Head/yast2...
Regards,
Kshitij Gupta
On Thu, Jul 4, 2013 at 2:10 AM, Kshitij Gupta
Hello everyone,
I am Kshitij and I'm working on Profile Tools for AppArmor using Python3 under Google Summer of Code'13.
This may have been asked before, but I tried searching on the net and asking on the IRC channel too but could not find an answer.
The present tools (in Perl) have a YaST interface besides the CLI, as I'm re-writing them in Python3 (Python 3.3 to be precise) and a few additional tools I also have to interface with YaST. I was able to find yast2-bindings for python but they are for Python2.7, but not for Python3.
I would be very grateful if somebody can help me in this regard.
Regards,
Kshitij Gupta -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
Hi Kshitij,
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 recommend you to
look at ruby bindings[1] that is now complete to cooperate with rest of
component system ( so ycp, perl or python modules ).
Project is available at github [2] and after few good commit (it is not
maintained, but we want to keep some basic code quality ) I think you
can get push rights.
Thanks
Josef
[1] https://github.com/yast/yast-ruby-bindings
[2] https://github.com/yast/yast-python-bindings
On Thu, 11 Jul 2013 22:48:44 +0530
Kshitij Gupta
Hello,
I spent some trying to figure out a way to port the bindings to Python3. I patched some config files (which I forked from cboltz's branch) to build the bindings with Python3. Then I realised that the C++ code needs to be modified too to match the Python3 C API. I found the following site, which guides on migrating code to Python:
http://python3porting.com/cextensions.html
Maybe somebody more familiar with the code-base can make the code compatible with both Python2 and 3 with some effort. Hope that might be helpful.
My branch: https://build.opensuse.org/package/show/home:kshitij8:branches:YaST:Head/yas...
cboltz's branch: https://build.opensuse.org/package/show/home:cboltz:branches:YaST:Head/yast2...
Regards,
Kshitij Gupta
On Thu, Jul 4, 2013 at 2:10 AM, Kshitij Gupta
wrote: Hello everyone,
I am Kshitij and I'm working on Profile Tools for AppArmor using Python3 under Google Summer of Code'13.
This may have been asked before, but I tried searching on the net and asking on the IRC channel too but could not find an answer.
The present tools (in Perl) have a YaST interface besides the CLI, as I'm re-writing them in Python3 (Python 3.3 to be precise) and a few additional tools I also have to interface with YaST. I was able to find yast2-bindings for python but they are for Python2.7, but not for Python3.
I would be very grateful if somebody can help me in this regard.
Regards,
Kshitij Gupta
-- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
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. Now to my question: Would it be possible to auto-generate the YaST python bindings with swig? Or are there some special things needed that can't be auto-generated? If using works with swig (or something similar), it would make maintenance _much_ easier. OTOH, it sounds too simple to be real ;-) Regards, Christian Boltz --
Als Newbie möchte ich wissen ob man unter Linux Vieren befürchten muß? Rein statisch gesehen, ist die Wahrscheinlichkeit, unter Linux von einer Vier erwischt zu werden, nicht größer, als eine Null verpaßt zu bekommen. [Christoph Lorentz in dcoulm!]
-- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
Hello, Am Samstag, 13. Juli 2013 schrieb Christian Boltz:
If using works with swig (or something similar), it would make
Argh - I shouldn't rephrase my mails too often ;-) This should read "If it works with swig [...]" Regards, Christian Boltz --
Naja das ist hier ziehmlich OT aber ich werde trotzdem mal meinen Senf hinzufügen. Senf? Beleidige nicht diese tolle Gewürzpaste, ja. ;-) [> "mrgates" und Matthias Houdek in suse-linux]
-- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org To contact the owner, e-mail: yast-devel+owner@opensuse.org
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):
participants (4)
-
Christian Boltz
-
Duncan Mac-Vicar P.
-
Josef Reidinger
-
Kshitij Gupta