[Zope-Checkins] CVS: Zope/lib/python/AccessControl -
DTML.py:1.10.70.3 Implementation.py:1.1.2.3
Tres Seaver
tseaver at zope.com
Fri Jan 16 10:56:03 EST 2004
Update of /cvs-repository/Zope/lib/python/AccessControl
In directory cvs.zope.org:/tmp/cvs-serv21624/lib/python/AccessControl
Modified Files:
Tag: Zope-2_7-branch
DTML.py Implementation.py
Log Message:
- Rationalize the injection of 'safe_builtins' into DTML's TemplateDict.
=== Zope/lib/python/AccessControl/DTML.py 1.10.70.2 => 1.10.70.3 ===
--- Zope/lib/python/AccessControl/DTML.py:1.10.70.2 Mon Jan 12 18:58:39 2004
+++ Zope/lib/python/AccessControl/DTML.py Fri Jan 16 10:56:01 2004
@@ -100,4 +100,6 @@
if r > 0: return r-1
return r
-DT_Util.TemplateDict.__dict__.update(DTMLSecurityAPI.__dict__)
+for name, v in DTMLSecurityAPI.__dict__.items():
+ if name[0] != '_':
+ setattr(DT_Util.TemplateDict, name, v)
=== Zope/lib/python/AccessControl/Implementation.py 1.1.2.2 => 1.1.2.3 ===
--- Zope/lib/python/AccessControl/Implementation.py:1.1.2.2 Mon Jan 12 18:58:39 2004
+++ Zope/lib/python/AccessControl/Implementation.py Fri Jan 16 10:56:01 2004
@@ -92,10 +92,8 @@
from DocumentTemplate import DT_Util
from ZopeGuards import safe_builtins
-_NEED_WRAPPING = ('max', 'min', 'iter', 'enumerate', 'sum')
-
-for k, v in safe_builtins.items():
- if k in _NEED_WRAPPING:
- v = DT_Util.NotBindable(v)
- DT_Util.TemplateDict.__dict__[k] = v
-
+for name, v in safe_builtins.items():
+ if name.startswith('__'):
+ continue
+ v = DT_Util.NotBindable(v)
+ setattr(DT_Util.TemplateDict, name, v)
More information about the Zope-Checkins
mailing list