GNOME Bugzilla – Bug 319417
[PATCH] Python bindings for libbeagle
Last modified: 2005-11-14 22:21:24 UTC
The attached files provide a python binding for libbeagle. I'm using it for deskbar-applet module in gnome CVS, maybe it's worth pushing it upstream.
Created attachment 53732 [details] beaglesearch.py Sample python script demonstrating the beagle searching, ported from the C libbeagle examples
Created attachment 53734 [details] pybeagle.tar.bz2 The package containing the needed files for binding libbeagle. NOT attached is the configure.ac snippet needed to build it. You can try the binding by checking out deskbar-applet module from gnome CVS: cvs -d :pserver:anoncvs@anoncvs.gnome.org:/cvs/gnome co deskbar-applet cd deskbar-applet ./autogen --enable-beagle cd deskbar/beagle ln -s .libs/_beagle.so _beagle.so cd ../ python beaglesearch.py It *should* work, if i get the approval to go on, i'll provide a patch for beagle's build system. Please let me know where to place the bindings itself.
Raphael: Very cool! We should definitely distribute these bindings along as part of Beagle. Please don't hold back: go ahead and integrate this stuff into our build. I think the bindings should probably go into a subdirectory under our top-level directory. i.e. beagle/pybeagle
Jon, Raphael: Wouldn't it be nice to have a wrappers/, that would have wrappers/glib, wrappers/python, wrappers/ruby etc?
Yeah, and subversion.
Ok, i'll put the bindings in beagle/wrappers/python, they will install a beagle module in /usr/lib/python2.x/site-packages/beagle.so. Patch to follow, today or tomorrow depending on the time i have.
Created attachment 53746 [details] [review] pybeagle.diff This is the patch for beagle's buildsystem. It may need a bit of work, cause currently even if you --disable-python i think you must have the deps, so it's a bad thing. I do not know enough of autoconf to make this, i'm sure you will be able to sort it out easily, all the elements are there.
Created attachment 53747 [details] pybeage.tar.gz The tarball to be decompressed in beagle root dir. It creates a wrappers/python directory with makefiles and source files. Everything must be added to CVS. the .defs file is semi-autogenerated, i had to tweak it a little, in case of API change use meld to merge the difference between the .defs.new generated by gen-defs.sh
Also, the example should be placed somewhere, i don't know exactly, you can figure that out, i suppose.
These are now in CVS.