make loading of R depend on environment variable USE_RLIBRARY
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2482 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
1e9418133b
commit
998cbf59cd
2 changed files with 16 additions and 24 deletions
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (c) 2007 Helmut Merz helmutm@cy55.de
|
||||
# Copyright (c) 2008 Helmut Merz helmutm@cy55.de
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -21,8 +21,7 @@
|
|||
$Id$
|
||||
"""
|
||||
|
||||
import new
|
||||
import re
|
||||
import os, re
|
||||
import compiler.pycodegen
|
||||
from cStringIO import StringIO
|
||||
from persistent import Persistent
|
||||
|
@ -37,13 +36,17 @@ from zope.security.untrustedpython.rcompile import RestrictionMutator as BaseRM
|
|||
from zope.traversing.api import getParent, getPath
|
||||
|
||||
from cybertools.pyscript.interfaces import IPythonScript, IScriptContainer
|
||||
try:
|
||||
#from cybertools.pyscript.rstat import r, rpy
|
||||
import rpy
|
||||
from rpy import r
|
||||
HAS_R = True
|
||||
except ImportError:
|
||||
HAS_R = False
|
||||
|
||||
HAS_R = use_R = bool(os.environ.get('USE_RLIBRARY', True))
|
||||
|
||||
if use_R:
|
||||
try:
|
||||
#from cybertools.pyscript.rstat import r, rpy
|
||||
import rpy
|
||||
from rpy import r
|
||||
HAS_R = True
|
||||
except ImportError:
|
||||
HAS_R = False
|
||||
|
||||
|
||||
unrestricted_objects = ('rpy', 'r', 'as_py', 'rstat')
|
||||
|
|
|
@ -1,17 +1,6 @@
|
|||
##############################################################################
|
||||
#
|
||||
# Copyright (c) 2004 Zope Corporation and Contributors.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# This software is subject to the provisions of the Zope Public License,
|
||||
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
|
||||
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
|
||||
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
|
||||
# FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
##############################################################################
|
||||
"""Tests for Python Page
|
||||
"""Tests for pyscript
|
||||
|
||||
Based on Zope Python Page.
|
||||
|
||||
$Id$
|
||||
"""
|
||||
|
|
Loading…
Add table
Reference in a new issue