You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Jens-Uwe Mager <ju...@anubis.han.de> on 2003/07/13 12:04:16 UTC

looking for python ra_dav sample code

I am looking for some boiler plate sample code for accessing a remote
repository via the svn python api. I have been looking through the
sample python scripts like mailer.py but these use local access. Is
there some sample code to copy from?
-- 
Jens-Uwe Mager	<pgp-mailto:F476EBC2>

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

Re: looking for python ra_dav sample code

Posted by Jens-Uwe Mager <ju...@anubis.han.de>.
On Mon, Jul 14, 2003 at 16:39 +0100, Stephen White wrote:

> ---- Original Message ----
> > From Jens-Uwe Mager <ju...@anubis.han.de>
> > Date: Sunday, 13 Jul 2003, 13:04
> >
> > I am looking for some boiler plate sample code for accessing a remote
> > repository via the svn python api. I have been looking through the
> > sample python scripts like mailer.py but these use local access. Is
> > there some sample code to copy from?
> 
> Here is a sample I was playing with a short time ago.

[ snipped sample ]

I got productive and have got some of these calls to work, like
svn_client_ls and folks. But what escapes me is how to create the stream
object in python that I have to give as the arg to svn_client_stream.
How is one supposed to make an instance of that one that is able to
_receive_ data?

-- 
Jens-Uwe Mager	<pgp-mailto:F476EBC2>

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

Re: looking for python ra_dav sample code

Posted by Stephen White <sw...@decisionsoft.com>.
---- Original Message ----
> From Jens-Uwe Mager <ju...@anubis.han.de>
> Date: Sunday, 13 Jul 2003, 13:04
>
> I am looking for some boiler plate sample code for accessing a remote
> repository via the svn python api. I have been looking through the
> sample python scripts like mailer.py but these use local access. Is
> there some sample code to copy from?

Here is a sample I was playing with a short time ago.


#!/usr/bin/python

from svn import wc, util, client

pool = util.svn_pool_create(None)

# create a list of authentication providers for the auth baton

providers = [
  #client.svn_client_get_simple_prompt_provider(pool),
  client.svn_client_get_simple_provider(pool),
  client.svn_client_get_simple_provider(pool)
  ]

auth_baton = util.svn_auth_open(providers, pool)

client_ctx = client.new_svn_client_ctx_t()

client.svn_client_ctx_t_auth_baton_set(client_ctx, auth_baton) # This accessor may change

rev = util.new_svn_opt_revision_t()
util.svn_opt_revision_t_kind_set(rev, util.svn_opt_revision_head)

#client.svn_client_checkout("file:///my/rep",
#                           "trunk",
#                           rev,
#                           1,     #recursive
#                           client_ctx,
#                           pool)
print client.svn_client_ls("http://svn.dsl.local/svn",rev,0,client_ctx,pool)

-- 
Stephen White                               +44-1865-203192
DecisionSoft Limited                        http://www.decisionsoft.com
XML Development and Services

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