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

Re: Learning the Python API - early questions

From: Barry Scott <barry_at_barrys-emacs.org>
Date: 2003-10-05 14:47:55 CEST

Russ,

That works. Now I'm trying to call svn_client_ls.

     files = svn.client.svn_client_ls( url, 0, ctx, pool )
TypeError: svn_client_ls() takes exactly 5 arguments (4 given)

The 1st in the C API apr_hash_t **dirents. It seems that the SWIG you
use to get the cfg_config is the same as for dirents so I'm not sure
why svn_config_get_config is happy to have me ommit the hash as the
1st param but svn_client_ls is not.

I now have this the test code below. I'm expecting that the ctx does not
have enough fields initialised yet, like password prompting.
In the case of the dirents I'm guessing that I do want it converted
to a python dict to all me to process it.

        Barry

import sys
import svn.core
import svn.client

def main(argv):
        url = argv[1]
        print 'Working on URL: %s' % url

        try:
                pool = svn.core.svn_pool_create(None)
                svn.core.svn_config_ensure( None, pool )

                ctx = svn.client.svn_client_ctx_t()
                print 'ctx:',repr(ctx)

                config = svn.core.svn_config_get_config( None, pool )
                
                print 'config repr:',repr(config)
                print 'config type:',type(config)

                ctx.config = config

                all_files = svn.client.svn_client_ls( url, 0, ctx, pool )
                print repr(all_files)
                print type(all_files)

        finally:
                svn.core.svn_pool_destroy(pool)

        return 0

if __name__ == '__main__':
        sys.exit( main( sys.argv ) )

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sun Oct 5 14:48:45 2003

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

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