[Zope-Checkins] CVS: Products/PageTemplates -
Expressions.py:1.43.44.4
Stefan H. Holek
stefan at epy.co.at
Thu Jan 27 09:55:58 EST 2005
Update of /cvs-repository/Products/PageTemplates
In directory cvs.zope.org:/tmp/cvs-serv10838/lib/python/Products/PageTemplates
Modified Files:
Tag: Zope-2_7-branch
Expressions.py
Log Message:
Got rid of import order dependencies in PageTemplates, TAL, and ZTUtils.
=== Products/PageTemplates/Expressions.py 1.43.44.3 => 1.43.44.4 ===
--- Products/PageTemplates/Expressions.py:1.43.44.3 Fri Jan 16 16:05:01 2004
+++ Products/PageTemplates/Expressions.py Thu Jan 27 09:55:28 2005
@@ -44,42 +44,13 @@
reg('not', NotExpr)
reg('defer', DeferExpr)
-if sys.modules.has_key('Zope'):
- import AccessControl
- import AccessControl.cAccessControl
- acquisition_security_filter = AccessControl.cAccessControl.aq_validate
- from AccessControl import getSecurityManager
- from AccessControl.ZopeGuards import guarded_getattr
- try:
- from AccessControl import Unauthorized
- except ImportError:
- Unauthorized = "Unauthorized"
- from ZRPythonExpr import PythonExpr, _SecureModuleImporter, call_with_ns
-else:
- from PythonExpr import getSecurityManager, PythonExpr
- guarded_getattr = getattr
- try:
- from zExceptions import Unauthorized
- except ImportError:
- Unauthorized = "Unauthorized"
-
- def acquisition_security_filter(orig, inst, name, v, real_validate):
- if real_validate(orig, inst, name, v):
- return 1
- raise Unauthorized, name
-
- def call_with_ns(f, ns, arg=1):
- if arg==2:
- return f(None, ns)
- else:
- return f(ns)
-
- class _SecureModuleImporter:
- """Simple version of the importer for use with trusted code."""
- __allow_access_to_unprotected_subobjects__ = 1
- def __getitem__(self, module):
- __import__(module)
- return sys.modules[module]
+import AccessControl
+import AccessControl.cAccessControl
+acquisition_security_filter = AccessControl.cAccessControl.aq_validate
+from AccessControl import getSecurityManager
+from AccessControl.ZopeGuards import guarded_getattr
+from AccessControl import Unauthorized
+from ZRPythonExpr import PythonExpr, _SecureModuleImporter, call_with_ns
SecureModuleImporter = _SecureModuleImporter()
More information about the Zope-Checkins
mailing list