put all R handling to pyscript; add view for showing graphics (plots) from tmp files created by R

git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2041 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2007-09-15 11:38:11 +00:00
parent 3f55fe3161
commit 714cc67541
3 changed files with 10 additions and 3 deletions

View file

@ -43,7 +43,10 @@ class PlotView(object):
return self
def __call__(self):
path = str('/' + os.path.join(*self.traverse_subpath))
if self.traverse_subpath:
path = str('/' + os.path.join(*self.traverse_subpath))
else:
path = self.request.form.get('image')
# TODO: keep path in temporary dictionary with hashed keys.
self.setHeaders(path)
f = open(path, 'rb')

View file

@ -43,7 +43,7 @@ class RWrapper(object):
return RWrapper(value)
r = RWrapper(r)
rx = RWrapper(r)
with_mode = RWrapper(rpy.with_mode)
#as_py = RWrapper(rpy.as_py)

View file

@ -38,7 +38,9 @@ from zope.traversing.api import getParent, getPath
from cybertools.pyscript.interfaces import IPythonScript, IScriptContainer
try:
from cybertools.pyscript.rstat import r, rpy
#from cybertools.pyscript.rstat import r, rpy
import rpy
from rpy import r
HAS_R = True
except ImportError:
HAS_R = False
@ -191,4 +193,6 @@ class ScriptContainer(BTreeContainer):
if HAS_R:
from cybertools.pyscript import rstat
globs['rstat'] = rstat
globs['r'] = r
globs['rpy'] = rpy