[ZPT] CVS: Zope/lib/python/Products/PageTemplates - Expressions.py:1.36.6.1.2.1 PageTemplate.py:1.25.6.2.2.1 PageTemplateFile.py:1.20.4.1 PythonExpr.py:1.8.8.1 TALES.py:1.31.8.1 ZopePageTemplate.py:1.43.4.1

Florent Guillaume fg@nuxeo.com
Sun, 15 Sep 2002 18:44:04 -0400


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

Modified Files:
      Tag: Zope-2_6-i18n-branch
	Expressions.py PageTemplate.py PageTemplateFile.py 
	PythonExpr.py TALES.py ZopePageTemplate.py 
Log Message:
Zope-2_6-i18n-branch is a branch off Zope-2_6-branch to integrate TAL
i18n from Zope27. This branch is based at tag Zope-2_6-i18n-base.

This first checkin is simply a direct copy of TAL and PageTemplates
tagged at baseline-for-Zope-2_6-i18n-branch in the Zope27 module, and
adapted to not get ImportErrors on interfaces. All tests pass (except
the usual failure due to expat bugs).



=== Zope/lib/python/Products/PageTemplates/Expressions.py 1.36.6.1 => 1.36.6.1.2.1 ===
--- Zope/lib/python/Products/PageTemplates/Expressions.py:1.36.6.1	Thu Sep 12 17:56:48 2002
+++ Zope/lib/python/Products/PageTemplates/Expressions.py	Sun Sep 15 18:43:33 2002
@@ -246,7 +246,10 @@
         self._c = compiler.compile(expr)
 
     def __call__(self, econtext):
-        return not econtext.evaluateBoolean(self._c)
+        # We use the (not x) and 1 or 0 formulation to avoid changing
+        # the representation of the result in Python 2.3, where the
+        # result of "not" becomes an instance of bool.
+        return (not econtext.evaluateBoolean(self._c)) and 1 or 0
 
     def __repr__(self):
         return 'not:%s' % `self._s`


=== Zope/lib/python/Products/PageTemplates/PageTemplate.py 1.25.6.2 => 1.25.6.2.2.1 ===
--- Zope/lib/python/Products/PageTemplates/PageTemplate.py:1.25.6.2	Sun Sep  8 23:06:51 2002
+++ Zope/lib/python/Products/PageTemplates/PageTemplate.py	Sun Sep 15 18:43:33 2002
@@ -24,7 +24,8 @@
 from TAL.TALGenerator import TALGenerator
 from TAL.TALInterpreter import TALInterpreter
 from Expressions import getEngine
-from cStringIO import StringIO
+# Do not use cStringIO here!  It's not unicode aware. :(
+from StringIO import StringIO
 from ExtensionClass import Base
 from ComputedAttribute import ComputedAttribute
 
@@ -208,3 +209,4 @@
         if e:
             w = list(w) + list(e)
         self.warnings = w
+


=== Zope/lib/python/Products/PageTemplates/PageTemplateFile.py 1.20 => 1.20.4.1 ===
--- Zope/lib/python/Products/PageTemplates/PageTemplateFile.py:1.20	Thu Sep  5 13:55:41 2002
+++ Zope/lib/python/Products/PageTemplates/PageTemplateFile.py	Sun Sep 15 18:43:33 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 => 1.8.8.1 ===
--- Zope/lib/python/Products/PageTemplates/PythonExpr.py:1.8	Wed Aug 14 18:17:24 2002
+++ Zope/lib/python/Products/PageTemplates/PythonExpr.py	Sun Sep 15 18:43:33 2002
@@ -78,3 +78,4 @@
     def __call__(self, text):
         return self._handler(self._name, text,
                              self._econtext._engine)(self._econtext)
+


=== Zope/lib/python/Products/PageTemplates/TALES.py 1.31 => 1.31.8.1 ===
--- Zope/lib/python/Products/PageTemplates/TALES.py:1.31	Wed Aug 14 18:17:24 2002
+++ Zope/lib/python/Products/PageTemplates/TALES.py	Sun Sep 15 18:43:33 2002
@@ -222,7 +222,7 @@
     def evaluateBoolean(self, expr):
         return not not self.evaluate(expr)
 
-    def evaluateText(self, expr, None=None):
+    def evaluateText(self, expr):
         text = self.evaluate(expr)
         if text is Default or text is None:
             return text
@@ -282,3 +282,4 @@
         return self._name, self._expr
     def __repr__(self):
         return '<SimpleExpr %s %s>' % (self._name, `self._expr`)
+


=== Zope/lib/python/Products/PageTemplates/ZopePageTemplate.py 1.43 => 1.43.4.1 ===
--- Zope/lib/python/Products/PageTemplates/ZopePageTemplate.py:1.43	Wed Aug 28 18:18:12 2002
+++ Zope/lib/python/Products/PageTemplates/ZopePageTemplate.py	Sun Sep 15 18:43:33 2002
@@ -369,3 +369,4 @@
         )
     context.registerHelp()
     context.registerHelpTitle('Zope Help')
+