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

Attempting to Use Python Bindings

From: Phil Bordelon <phil_at_lsu.edu>
Date: 2006-03-10 21:13:09 CET

[I'm not subscribed to this list, but I /do/ read it semi-regularly via svn.haxx.se, so never
fear if you forget to send a reply to me directly. It would be appreciated, though.]

Hello there.

I'm trying to use the Python bindings to Subversion for writing a very simple client instead of
going the "cheap" way and wrapping the executable. (For our uses, wrapping the executable is
almost certainly the easy and quick way, since I'm not using much functionality at all, but I
wanted to try using it The Right Way.)

However, the lack of documentation on the Python API is hampering my efforts. I can look at the
svn/client.py file in my Python directory, and it implies that most of the API calls aren't very
different from the C ones. But when I try to call, say, svn_client_ls2, it tells me that it needs
six parameters. Which six? I assume (perhaps wrongly! I don't see the code where this is, there's
no _client.py; I assume this is something SWIGgy) that the svn_client_ctx_t object is the one that
I'm supposed to elide, since it seems that the Python version of svn_client_create_context doesn't
return anything particularly useful, and takes only one parameter (which I'm assuming, once again,
is the APR pool). But I have no idea what dirents is supposed to be set to, and when I attempt to
set it to an empty variable, it complains that it should be a string ... which implies that the first
parameter is, in fact, path_or_url.

I think I'm going to end up just wrapping the executable, since I don't want to use pysvn (superior
though it may be, it's not a stock part of SUSE on z/Linux, and I'm trying to keep overhead and
maintenance minimal). But even a Python "simple client usage" a la the C examples would be greatly
appreciated by those of us who do not have a deep understanding of the underpinnings of Subversion. I
try to keep up with this mailing list; I find Subversion a fantastic project, and I use it for all of
my own revision control needs. But using the Python bindings is, well, scary and uncharted for me.
(I even pulled down the Trac code to see how /they/ do it, but it looks like they talk to the wc
directly, and wrap it all up in objects.)

Phil Bordelon

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Mar 13 02:58:36 2006

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.