[ZPT] CVS: Zope/lib/python/Products/PageTemplates - Expressions.py:1.36.4.4 GlobalTranslationService.py:1.2.2.3 PageTemplate.py:1.25.4.4 PageTemplateFile.py:1.19.4.4 PythonExpr.py:1.8.4.3 TALES.py:1.31.4.3 ZopePageTemplate.py:1.42.4.6

Chris McDonough chrism@zope.com
Tue, 8 Oct 2002 17:46:22 -0400


Update of /cvs-repository/Zope/lib/python/Products/PageTemplates
In directory cvs.zope.org:/tmp/cvs-serv17057/lib/python/Products/PageTemplates

Modified Files:
      Tag: chrism-install-branch
	Expressions.py GlobalTranslationService.py PageTemplate.py 
	PageTemplateFile.py PythonExpr.py TALES.py ZopePageTemplate.py 
Log Message:
More merges from HEAD.


=== Zope/lib/python/Products/PageTemplates/Expressions.py 1.36.4.3 => 1.36.4.4 ===


=== Zope/lib/python/Products/PageTemplates/GlobalTranslationService.py 1.2.2.2 => 1.2.2.3 ===


=== Zope/lib/python/Products/PageTemplates/PageTemplate.py 1.25.4.3 => 1.25.4.4 ===
--- Zope/lib/python/Products/PageTemplates/PageTemplate.py:1.25.4.3	Tue Oct  8 14:41:07 2002
+++ Zope/lib/python/Products/PageTemplates/PageTemplate.py	Tue Oct  8 17:45:50 2002
@@ -22,9 +22,9 @@
 from TAL.TALParser import TALParser
 from TAL.HTMLTALParser import HTMLTALParser
 from TAL.TALGenerator import TALGenerator
-from TAL.TALInterpreter import TALInterpreter
+# Do not use cStringIO here!  It's not unicode aware. :(
+from TAL.TALInterpreter import TALInterpreter, FasterStringIO
 from Expressions import getEngine
-from cStringIO import StringIO
 from ExtensionClass import Base
 from ComputedAttribute import ComputedAttribute
 
@@ -43,6 +43,11 @@
     _text = ''
     _error_start = '<!-- Page Template Diagnostics'
 
+    def StringIO(self):
+        # Third-party products wishing to provide a full Unicode-aware
+        # StringIO can do so by monkey-patching this method.
+        return FasterStringIO()
+
     def macros(self):
         return self.pt_macros()
     macros = ComputedAttribute(macros, 1)
@@ -80,7 +85,7 @@
 
         if self._v_errors:
             raise PTRuntimeError, 'Page Template %s has errors.' % self.id
-        output = StringIO()
+        output = self.StringIO()
         c = self.pt_getContext()
         c.update(extra_context)
 
@@ -126,7 +131,7 @@
     def write(self, text):
         assert type(text) is type('')
         if text[:len(self._error_start)] == self._error_start:
-            errend = find(text, '-->')
+            errend = text.find('-->')
             if errend >= 0:
                 text = text[errend + 4:]
         if self._text != text:
@@ -203,3 +208,4 @@
         if e:
             w = list(w) + list(e)
         self.warnings = w
+


=== Zope/lib/python/Products/PageTemplates/PageTemplateFile.py 1.19.4.3 => 1.19.4.4 ===
--- Zope/lib/python/Products/PageTemplates/PageTemplateFile.py:1.19.4.3	Tue Oct  8 14:41:07 2002
+++ Zope/lib/python/Products/PageTemplates/PageTemplateFile.py	Tue Oct  8 17:45:50 2002
@@ -85,7 +85,8 @@
             response = self.REQUEST.RESPONSE
             if not response.headers.has_key('content-type'):
                 response.setHeader('content-type', self.content_type)
-        except AttributeError: pass
+        except AttributeError:
+            pass
 
         # Execute the template in a new security context.
         security=getSecurityManager()


=== Zope/lib/python/Products/PageTemplates/PythonExpr.py 1.8.4.2 => 1.8.4.3 ===


=== Zope/lib/python/Products/PageTemplates/TALES.py 1.31.4.2 => 1.31.4.3 ===


=== Zope/lib/python/Products/PageTemplates/ZopePageTemplate.py 1.42.4.5 => 1.42.4.6 ===