[maemo-developers] Writing a Python binding of a C library that uses GObject
From: Anderson Lizardo anderson.lizardo at openbossa.orgDate: Tue Jul 14 17:48:33 EEST 2009
- Previous message: Writing a Python binding of a C library that uses GObject
- Next message: maemo-developers Digest, Vol 51, Issue 14
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Tue, Jul 14, 2009 at 9:58 AM, Andrea Grandi<a.grandi at gmail.com> wrote: > Hi all, > > I'm writing a Python binding for a C library that runs on Maemo and, > since it's the first binding I write, I've some questions. I hope that it is not one of the official Maemo C libraries, because in that case you might want to coordinate with the PyMaemo team (specially create a bug entry for it). Right now we are working on hildon-notify and MAFW bindings. > I've read the chapter "Extending Python with C" in a couple of manuals > and I've read the online documentation too, but some parts are no > covered yet. For sure, the GObject machinery has its own way to interface with Python, through the pygobject tools. There is a (mostly undocumented, AFAIK) tool from PyGtk called "codegen", that can be used to automate most of the work of generating bindings for GObject based libraries. python-hildon uses this tool to automate most of the binding. My suggestion is to look at some existing (simple) binding and do your work based on it. I would suggest taking a look at python-hildon, and in a script called "hildon_gen_defs.sh" there where we automate most of the process: https://garage.maemo.org/svn/pymaemo/packages/python-hildon/trunk/ Hope that helps, -- Anderson Lizardo OpenBossa Labs - INdT Manaus - Brazil
- Previous message: Writing a Python binding of a C library that uses GObject
- Next message: maemo-developers Digest, Vol 51, Issue 14
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]