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

How do I call svn_client_list2 C API function from python via SVN API SWIG bindings?

From: Tarmo Aidantausta <bleadof_at_gmail.com>
Date: Wed, 19 Aug 2009 15:23:29 +0300

The question

How do I call svn_client_list2 C API function from python via SVN API
SWIG bindings?

Problem description

I can find that function from the svn.client module, but calling it is
the problem, because the callback function it uses is a typedef
svn_client_list_func_t and I don't know how to use that typedef in

Although I can find a class for it from
svn.client.svn_client_list_func_t along with
svn.client.svn_client_list_func_tPtr, but I can't find an example of
how to use it.

Incorrect usage of svn.client.svn_client_list2

If you call the svn.client.svn_client_list2 function with a normal
python function as callback parameter it gives you an error.

import svn.core, svn.client

path = svn.core.svn_path_canonicalize("/path/to/a/working_copy/")
pool = svn.core.Pool()
ctx = svn.client.svn_client_create_context(pool)
revision = svn.core.svn_opt_revision_t()
SVN_DIRENT_ALL = 0xffffffffl
def _handle_list(path, dirent, abs_path, pool):
  print(path, dirent, abs_path, pool)


TypeError: argument number 7: a 'svn_client_list_func_t *' is
expected, 'function()' is received

Incorrect usage of svn.client.svn_client_list_func_t

Trying to initialize the svn.client.svn_client_list_func_t will result
to an exception.

 callback_function = svn.client.svn_client_list_func_t()
RuntimeError: No constructor defined

Ideas how I can proceed?

This question is on StackOverflow as well:

 Tarmo Aidantausta
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-08-19 14:30:45 CEST

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.