Daniel Yuan wrote:
> I'm following up on bug 2776713 re. how to set a cleanup callback  
> using setCleanUp 
> (https://sourceforge.net/tracker/?func=detail&aid=2776713&group_id=48422&atid=453021
>  
> ).
> 
> The only place I saw 'setCleanUp' defined was in 'rpy2/rpy/rinterface/ 
> rinterface.c'. I assume this is *not* the place to set the callback.

It is somehow the place to set the cleanup function (by calling the 
function from python rather than by editing the C code).
The thing is still experimental, but should be sort of working now. 
Please do not hesitate to report what works, and what does not.

I have just added something in the documentation for 2.1-dev
http://rpy.sourceforge.net/rpy2/doc-dev/html/callbacks.html#clean-up
That will hopefully be enough to get you started.

[note that the API is still changing and that the getters and setters 
for the callbacks are now following the general python trend to avoid 
camel-casing for function names]


L.



> There is a 'cleanUp' function definition and a call to  
> 'setCleanUp(cleanUp)' in 'rpy2/rpy/rinterface/__init__.py', but they  
> were commented out (rpy2 version 2.1-dev build 674). When I  
> uncommented these lines and reinstalled rpy2, the "Bus error" I had  
> noted earlier in my example code went away. But python still quits and  
> dumps me into the bash shell:
> 
> xn...@work:~/tmp/rpy2> python
> Python 2.5.2 (r252:60911, Nov 26 2008, 00:44:29)
> [GCC 4.0.1 (Apple Inc. build 5490)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> import rpy2.robjects as robjects
>  >>> r = robjects.r
>  >>> print r('a <- 1')
> [1] 1
>  >>> print r('q(save="no")')
> xn...@work:~/tmp/rpy2>
> 
> Is there something else I can try?
> 
> Thanks.
> 
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> rpy-list mailing list
> rpy-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rpy-list


------------------------------------------------------------------------------
_______________________________________________
rpy-list mailing list
rpy-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rpy-list

Reply via email to