[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Help with Python SWIG bindings and callbacks

From: David James <james82_at_gmail.com>
Date: Mon, 25 Aug 2008 21:35:07 -0700

On Mon, Aug 25, 2008 at 7:33 PM, Lawrence Stewart <lstewart_at_room52.net> wrote:
>>> One really nice part about the ctypes python bindings is that you
>>> don't need to recompile the bindings for it to work with a different
>>> version of Subversion, or a different platform -- it's a pure python
>>> binding.
>
> Sounds too good to be true! If I'm understanding you correctly, the ctypes
> python module does the necessary magic to tie the low level python-svn API
> code to the underlying raw SVN C APIs without any SVN C code glue? Then you
> just layer some additional Python classes on top and that's it?

Yup. In fact, you don't even need to have any Python classes on top --
you can just use the raw C APIs if you want, directly from Python. The
ctypes-python-bindings use ctypesgen
(http://code.google.com/p/ctypesgen/) to generate ctypes definitions,
which tell ctypes what functions are in the files, and what the types
of each argument are, so that you can access the C functions and C
structs easily from within python without needing to do any
declarations yourself.

The high level Python classes in the ctypes-python-bindings are there
for convenience only, for the most common tasks you need to do with
the SVN API. If you have tasks that the convenience API doesn't
support it might be a good idea to write some more classes and
contribute them back to the ctypes python bindings. But strictly
speaking that isn't necessary, because you can just use the low level
bindings.

Cheers,

David

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-08-26 06:35:48 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.