You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Alexis Boutillier <al...@arteris.net> on 2004/03/12 09:22:06 UTC

python swig binding problem with _p_p_apr_hash_t

Hi,

I try to make a client program that read the entries so i wanted to test 
the svn_wc_entries_read() fonction of the wc package.

but i don't known how to use it and how to create an "_p_p_apr_hash_t" 
type to return the entries. I try to pass a dictionnary but it return an 
error like this :
Traceback (most recent call last):
   File "test.py", line 45, in ?
     core.run_app(check)
   File "/opt/alexis/svn1.0/lib/svn-python/svn/core.py", line 33, in run_app
     return apply(func, (pool,) + args, kw)
   File "test.py", line 27, in check
     t = wc.svn_wc_entries_read(listres,adm_baton,True,pool)
TypeError: Expected a pointer

i don't know how to create an apr_hash_t in the pool there is no function 
availlable to do so.


this is the python code :

check(pool):
	adm_baton = wc.svn_wc_adm_open(None , dir, 1, 1, pool)
	listres = {}
	t = wc.svn_wc_entries_read(listres,adm_baton,True,pool)

if __name__ == '__main__':
	core.run_app(check)


thanks for the help.

-- 
Boutillier Alexis
Methodology engineer

Arteris SA
The Network-on-Chip Company (TM)
www.arteris.net

6 parc Ariane Immeuble Mercure
78284 Guyancourt Cedex
France
Office: (+33) 1 61 37 38 71
Fac:    (+33) 1 61 37 38 41
Alexis.Boutillier@arteris.net

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

Re: python swig binding problem with _p_p_apr_hash_t

Posted by "C. Michael Pilato" <cm...@collab.net>.
Alexis Boutillier <al...@arteris.net> writes:

> I try to make a client program that read the entries so i wanted to
> test the svn_wc_entries_read() fonction of the wc package.

svn_wc_entries_read() creates a hash in the C interface (note the two
asterisks in the header file), so generally we make the bindings just
return that hash.  We don't typically care about returning an error
code because Python has an Exception system for that.

> this is the python code :
> 
> check(pool):
> 	adm_baton = wc.svn_wc_adm_open(None , dir, 1, 1, pool)
> 	listres = {}
> 	t = wc.svn_wc_entries_read(listres,adm_baton,True,pool)

So, try:

	adm_baton = wc.svn_wc_adm_open(None, dir, 1, 1, pool)
 	listres = wc.svn_wc_entries_read(adm_baton, 1, pool)

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

Re: python swig binding problem with _p_p_apr_hash_t

Posted by Barry Scott <ba...@barrys-emacs.org>.
You might find pysvn an easier way to access client functionality from python
then the swig bindings. pysvn was written to avoid needing to know about all
the apr and other low level svn API's. See http://pysvn.tigris.org for
documentation, binary and source kits.

Barry

At 12-03-2004 09:22, Alexis Boutillier wrote:
>Hi,
>
>I try to make a client program that read the entries so i wanted to test 
>the svn_wc_entries_read() fonction of the wc package.
>
>but i don't known how to use it and how to create an "_p_p_apr_hash_t" 
>type to return the entries. I try to pass a dictionnary but it return an 
>error like this :
>Traceback (most recent call last):
>   File "test.py", line 45, in ?
>     core.run_app(check)
>   File "/opt/alexis/svn1.0/lib/svn-python/svn/core.py", line 33, in run_app
>     return apply(func, (pool,) + args, kw)
>   File "test.py", line 27, in check
>     t = wc.svn_wc_entries_read(listres,adm_baton,True,pool)
>TypeError: Expected a pointer
>
>i don't know how to create an apr_hash_t in the pool there is no function 
>availlable to do so.
>
>
>this is the python code :
>
>check(pool):
>         adm_baton = wc.svn_wc_adm_open(None , dir, 1, 1, pool)
>         listres = {}
>         t = wc.svn_wc_entries_read(listres,adm_baton,True,pool)
>
>if __name__ == '__main__':
>         core.run_app(check)
>
>
>thanks for the help.
>
>--
>Boutillier Alexis
>Methodology engineer
>
>Arteris SA
>The Network-on-Chip Company (TM)
>www.arteris.net
>
>6 parc Ariane Immeuble Mercure
>78284 Guyancourt Cedex
>France
>Office: (+33) 1 61 37 38 71
>Fac:    (+33) 1 61 37 38 41
>Alexis.Boutillier@arteris.net
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
>For additional commands, e-mail: users-help@subversion.tigris.org
>



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