[Zope-Checkins] CVS: Zope/lib/python/DocumentTemplate - DT_Util.py:1.89.36.1 cDocumentTemplate.c:1.48.94.1

Jim Fulton cvs-admin at zope.org
Tue Nov 25 15:17:59 EST 2003


Update of /cvs-repository/Zope/lib/python/DocumentTemplate
In directory cvs.zope.org:/tmp/cvs-serv24052/lib/python/DocumentTemplate

Modified Files:
      Tag: Zope-2_8-devel-branch
	DT_Util.py cDocumentTemplate.c 
Log Message:
merged everything but ZODB and ZEO from zodb33-devel-branch


=== Zope/lib/python/DocumentTemplate/DT_Util.py 1.89 => 1.89.36.1 ===
--- Zope/lib/python/DocumentTemplate/DT_Util.py:1.89	Thu Feb 27 12:31:27 2003
+++ Zope/lib/python/DocumentTemplate/DT_Util.py	Tue Nov 25 15:17:28 2003
@@ -42,8 +42,9 @@
     import ExtensionClass
     from cDocumentTemplate import InstanceDict, TemplateDict, \
          render_blocks, safe_callable, join_unicode
-except: from pDocumentTemplate import InstanceDict, TemplateDict, \
-        render_blocks, safe_callable, join_unicode
+except:
+    from pDocumentTemplate import InstanceDict, TemplateDict, \
+         render_blocks, safe_callable, join_unicode
 
 functype = type(int_param)
 class NotBindable:
@@ -51,21 +52,18 @@
     def __init__(self, f):
         self.__call__ = f
 
-d = TemplateDict.__dict__
 for name, f in safe_builtins.items() + utility_builtins.items():
     if type(f) is functype:
-        d[name] = NotBindable(f)
-    else:
-        d[name] = f
+        f = NotBindable(f)
+    setattr(TemplateDict, name, f)
 
 if LIMITED_BUILTINS:
     # Replace certain builtins with limited versions.
     from RestrictedPython.Limits import limited_builtins
     for name, f in limited_builtins.items():
         if type(f) is functype:
-            d[name] = NotBindable(f)
-        else:
-            d[name] = f
+            f = NotBindable(f)
+        setattr(TemplateDict, name, f)
 
 try:
     # Wrap the string module so it can deal with TaintedString strings.
@@ -104,7 +102,7 @@
                 retval = TaintedString(retval)
             return retval
 
-    d['string'] = StringModuleWrapper()
+    TemplateDict.string = StringModuleWrapper()
 
 except ImportError:
     # Use the string module already defined in RestrictedPython.Utilities
@@ -138,8 +136,8 @@
     else:
         return 1
 
-d['getattr']=careful_getattr
-d['hasattr']=careful_hasattr
+TemplateDict.getattr = careful_getattr
+TemplateDict.hasattr = careful_hasattr
 
 def namespace(self, **kw):
     """Create a tuple consisting of a single instance whose attributes are
@@ -152,7 +150,7 @@
         information may contain more details.)'''
     return self(**kw)
 
-d['namespace']=namespace
+TemplateDict.namespace = namespace
 
 def render(self, v):
     "Render an object in the way done by the 'name' attribute"
@@ -167,7 +165,7 @@
                 v = v()
     return v
 
-d['render']=render
+TemplateDict.render = render
 
 
 class Eval(RestrictionCapableEval):


=== Zope/lib/python/DocumentTemplate/cDocumentTemplate.c 1.48 => 1.48.94.1 ===
--- Zope/lib/python/DocumentTemplate/cDocumentTemplate.c:1.48	Mon Aug  5 16:51:14 2002
+++ Zope/lib/python/DocumentTemplate/cDocumentTemplate.c	Tue Nov 25 15:17:28 2003
@@ -922,7 +922,8 @@
             PyObject *item = PyList_GetItem(list,i);
             if(PyString_Check(item))
             {
-                PyObject *unicode = PyUnicode_DecodeLatin1(PyString_AsString(item),PyString_Size(item),NULL);
+                PyObject *unicode = PyUnicode_DecodeLatin1(
+                    PyString_AsString(item),PyString_Size(item),NULL);
                 if(unicode)
                 {
                     PyList_SetItem(list,i,unicode);




More information about the Zope-Checkins mailing list