Revision: 420
http://rpy.svn.sourceforge.net/rpy/?rev=420&view=rev
Author: lgautier
Date: 2008-03-08 01:46:52 -0800 (Sat, 08 Mar 2008)
Log Message:
-----------
Fixed methods __str__ and __repr__ for Robject
Modified Paths:
--------------
trunk/sandbox/rpy_nextgen/robjects/__init__.py
Modified: trunk/sandbox/rpy_nextgen/robjects/__init__.py
===================================================================
--- trunk/sandbox/rpy_nextgen/robjects/__init__.py 2008-03-08 09:03:12 UTC
(rev 419)
+++ trunk/sandbox/rpy_nextgen/robjects/__init__.py 2008-03-08 09:46:52 UTC
(rev 420)
@@ -6,6 +6,7 @@
"""
+import os
import array
import rinterface
@@ -58,9 +59,20 @@
#FIXME: Looks hackish. inheritance should be used ?
class Robject(object):
- def __repr__(self):
+ def __str__(self):
+ tmp = r.fifo("")
+ r.sink(tmp)
r.show(self)
+ r.sink()
+ s = r.readLines(tmp)
+ r.close(tmp)
+ s = str.join(os.linesep, s)
+ return s
+ def __repr__(self):
+ s = r.deparse(self)
+ s = str.join(os.linesep, s)
+ return s
class Rvector(Robject):
""" R vector-like object. Items in those instances can
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
rpy-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rpy-list