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:
helmutm 2008-03-29 15:51:02 +00:00
parent 1e9418133b
commit 998cbf59cd
2 changed files with 16 additions and 24 deletions

View file

@ -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 # 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 # it under the terms of the GNU General Public License as published by
@ -21,8 +21,7 @@
$Id$ $Id$
""" """
import new import os, re
import re
import compiler.pycodegen import compiler.pycodegen
from cStringIO import StringIO from cStringIO import StringIO
from persistent import Persistent from persistent import Persistent
@ -37,12 +36,16 @@ from zope.security.untrustedpython.rcompile import RestrictionMutator as BaseRM
from zope.traversing.api import getParent, getPath from zope.traversing.api import getParent, getPath
from cybertools.pyscript.interfaces import IPythonScript, IScriptContainer from cybertools.pyscript.interfaces import IPythonScript, IScriptContainer
try:
HAS_R = use_R = bool(os.environ.get('USE_RLIBRARY', True))
if use_R:
try:
#from cybertools.pyscript.rstat import r, rpy #from cybertools.pyscript.rstat import r, rpy
import rpy import rpy
from rpy import r from rpy import r
HAS_R = True HAS_R = True
except ImportError: except ImportError:
HAS_R = False HAS_R = False

View file

@ -1,17 +1,6 @@
############################################################################## """Tests for pyscript
#
# Copyright (c) 2004 Zope Corporation and Contributors. Based on Zope Python Page.
# 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
$Id$ $Id$
""" """