You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Jerry Haltom <wa...@larvalstage.net> on 2003/07/13 01:46:30 UTC

Python Bindings

I have been working all day, trying to figure out how to do some
interfacing with a remote SVN repos using Python, and I think I have
reached the conclusion that the Python bindings are totally broken. Am I
correct?

I've been using the C API as a referenc as best I cane, and looking thru
the SWIG sources, as well as the stuff in
/usr/local/python2.2/site-packages/(lib)svn.

First, I can't figure out how one would create an auth_baton. I cannot
locate a baton class. Second, to populate this class, I would need to
present an apr_array_header_t, also which doesn't seem to exist.

Anybody working with the Python bindings currently? Are they known to be
broken? I see that they do work for local repositories. However, I can't
imagine that more people use local repositories than remote ones.

Jerry Haltom
Feedback Plus, Inc.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Python Bindings

Posted by Russell Yanofsky <re...@columbia.edu>.
Jerry Haltom wrote:
> Thanks! Just before you sent this message, I figured it out (after
> searching thru the SWIG interfaces and finding special handing for
> providers).
>
> You sound like you've done this before. Do you have any sample code?

I've only used the python bindings in tinkering with ViewCVS
(http://viewcvs.sf.net/). But basically everything you need to know about the
Subversion API's is in the public headers (subversion/include/*.h) which are
very well documented. And if you need to know python-specific information like
how arguments and return values are handled you can look at the generated swig
code (subversion/bindings/swig/python/*.c) which is pretty readable and
intuitive.

- Russ





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Python Bindings

Posted by Jerry Haltom <wa...@larvalstage.net>.
Thanks! Just before you sent this message, I figured it out (after
searching thru the SWIG interfaces and finding special handing for
providers).

You sound like you've done this before. Do you have any sample code?

On Sun, 2003-07-13 at 14:40, Russell Yanofsky wrote:
> Jerry Haltom wrote:
> > Thanks, I see that.
> >
> > What about creating a apr_array_header_t to pass to svn_auth_open?
> > Still
> > using Python.
> 
> Just pass in a python list, it should be automatically converted to an apr
> array.
> 
> - Russ
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Python Bindings

Posted by Russell Yanofsky <re...@columbia.edu>.
Jerry Haltom wrote:
> Thanks, I see that.
>
> What about creating a apr_array_header_t to pass to svn_auth_open?
> Still
> using Python.

Just pass in a python list, it should be automatically converted to an apr
array.

- Russ




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Python Bindings

Posted by Jerry Haltom <wa...@larvalstage.net>.
Thanks, I see that.

What about creating a apr_array_header_t to pass to svn_auth_open? Still
using Python.

On Sun, 2003-07-13 at 04:09, Russell Yanofsky wrote:
> Jerry Haltom wrote:
> > ...
> > First, I can't figure out how one would create an auth_baton. I cannot
> > locate a baton class. Second, to populate this class, I would need to
> > present an apr_array_header_t, also which doesn't seem to exist.
> 
> I don't really know anything about the authentication API specifcally, but the
> auth_baton struct is not defined in the public headers, only declared as:
> 
>   typedef struct svn_auth_baton_t svn_auth_baton_t;
> 
> This means you have to treat it as an opaque type. You can't instantiate it
> directly or access its members. If you want an instance, you have to call an api
> function that returns one (like svn_auth_open()).
> 
> - Russ
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Python Bindings

Posted by Russell Yanofsky <re...@columbia.edu>.
Jerry Haltom wrote:
> ...
> First, I can't figure out how one would create an auth_baton. I cannot
> locate a baton class. Second, to populate this class, I would need to
> present an apr_array_header_t, also which doesn't seem to exist.

I don't really know anything about the authentication API specifcally, but the
auth_baton struct is not defined in the public headers, only declared as:

  typedef struct svn_auth_baton_t svn_auth_baton_t;

This means you have to treat it as an opaque type. You can't instantiate it
directly or access its members. If you want an instance, you have to call an api
function that returns one (like svn_auth_open()).

- Russ




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org