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

Re: Can svn_config_enumerate() be called from python?

From: Max Bowsher <maxb_at_ukf.net>
Date: 2005-09-13 16:50:28 CEST

Ximon Eighteen wrote:
> Hi all,
>
> I've been looking all over the place giving myself a rather drastic crash
> course in python, subversion, swig, viewcvs, trac, the subversion book etc
> in an attempt to answer for myself whether or not I can call
> svn_config_enumerate from python using the swig bindings.
>
> In subversion 1.2.1 I can call it but only if the callback func parameter
> is
> passed as None - anything else causes "TypeError: Expected a pointer".
>
> Can anyone either show me how I can use a callback python function with
> svn_config_enumerate, tell me I should be doing this another way (e.g.
> just
> use config methods that don't require a callback) or set me straight on
> what
> is and isn't possible so that I can perhaps focus my research efforts on
> helping to fix (in subversion with a patch if necessary) my problem.

Swig, whilst being wonderful at automatically wrapping ordinary functions,
doesn't automatically do very much to help with callback functions.
Each callback type has to be manually wrapped. If that has not been done,
the functions requiring them cannot be used.

> A quick bit of background for you. I started on this problem when I
> submitted a patch to the ViewCVS project to allow authorisation using the
> mod_authz_svn configuration file. I hated my patch because it's hacky and
> it used some trac code which isn't on (my patch was meant as an example of
> what can work and stated I didn't mean for code to be incorporated
> directly
> into viewcvs by stealing it from trac). I wanted to replace the code
> borrowed from trac with python code that calls the exact same subversion
> apis as mod_authz_svn does instead of writing new code to interpret the
> mod_authz_svn config file (why reinvent the wheel and a whole host of new
> mistakes to boot?) and then I ran into the problem with
> svn_config_enumerate.

The Subversion configuration format is intended to be identical to that
supported by the core Python module ConfigParser. (We might be forced to
change that someday, to support usernames containing the characters '=' and
':', but for the moment, it is true.)

Max.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Sep 13 16:51:27 2005

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.