GNOME Bugzilla – Bug 457660
[Patch] Python bindings
Last modified: 2007-08-19 19:59:10 UTC
Attached are bindings for libempathy and libempathy-gtk, they don't completely wrap all functions and there are still a few problems that need fixing but in general they're usable.
Created attachment 91894 [details] [review] Python bindings for libempathy and libempathy-gtk
Thanks for the patch, I have some comments: 1) Is it possible to move all python thinkgs into a separate directory? Like python/pyempathy and python/pyempathy-gtk. 2) I guess .defs files are generated at build-time, so it shouldn't be in the patch, or I'm wrong? 3) Makefile.bindings shouldn't hardcode CFLAFS and LDFLAGS. I think that should be in a Makefile.am with an option in configure.ac to optionally compile the python bindings. Something like ./configure --enable-python. Thanks !
Answering question 2 - Usually the .defs are generated manually and shipped with the package, , as they can be edited to make a more suitable API instead of just wrapping C functions or due to limitations in the generator.
Created attachment 93823 [details] [review] Improved python bindings for libempathy and libempathy-gtk * Bindings are now in a separate directory. * Fully using autotools for building, with the switch --enable-python. * Updated to work with current HEAD (~0.11) As Lauro mentioned the .defs files have to be tweaked manually after generation (the code generator can't handle certain things, such as GObject interfaces). I've also updated the bindings.
Created attachment 93842 [details] [review] Improved python bindings for libempathy and libempathy-gtk * Renamed module from libpyempathy and libpyempathygtk to simply empathy and empathygtk * Fixed conflict when loading empathy and empathygtk simultaniously
Created attachment 93944 [details] [review] Improved python bindings for libempathy and libempathy-gtk * Work out the python installation directory in configure.ac instead of Makefile.am * Obey --prefix for python module installation
I committed with some changes: 1) Moved code from libemapthy(gtk)/python to python/pyempathy(gtk) 2) Replaced the horrible install thing from Makefile.am by some autofoo magic. 3) Changed a bit the configure.ac code to detect if python binding must be compiled. It would be cool to add an example.py in python/ to demonstrate how to use the binding. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.