Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I call the svn.client.svn_client_list2 with python SVN API SWIG bindings?
    text
    copied!<h1>The question</h1> <p>How do I call <a href="http://svn.collab.net/svn-doxygen/group__List.html#ga1" rel="nofollow noreferrer"><code>svn_client_list2</code></a> C API function from python via SVN API SWIG bindings?</p> <h1>Problem description</h1> <p>I can find that function from the <code>svn.client</code> module, but <strong>calling it is the problem</strong>, because the callback function it uses is a typedef <a href="http://svn.collab.net/svn-doxygen/group__List.html#ga0" rel="nofollow noreferrer"><code>svn_client_list_func_t</code></a> and I don't know how to use that typedef in python. </p> <p>Although I can find a class for it from <code>svn.client.svn_client_list_func_t</code> along with <code>svn.client.svn_client_list_func_tPtr</code>, but I can't find an example of how to use it.</p> <h2>Incorrect usage of svn.client.svn_client_list2</h2> <p>If you call the <code>svn.client.svn_client_list2</code> function with a normal python function as callback parameter it gives you an error.</p> <p><code></p> <pre><code>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) svn.client.svn_client_list2(path, revision, revision, svn.core.svn_depth_infinity, SVN_DIRENT_ALL, True, _handle_list, ctx, pool) </code></pre> <p></code></p> <p><code>TypeError: argument number 7: a 'svn_client_list_func_t *' is expected, 'function(&lt;function _handle_list at 0x01365270&gt;)' is received</code> </p> <h2>Incorrect usage of svn.client.svn_client_list_func_t</h2> <p>Trying to initialize the <code>svn.client.svn_client_list_func_t</code> will result to an exception.</p> <p><code></p> <pre><code>callback_function = svn.client.svn_client_list_func_t() </code></pre> <p></code></p> <p><code>RuntimeError: No constructor defined</code></p> <p>Ideas how I can proceed?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload