[ZPT] CVS: Zope/lib/python/Products/PageTemplates - Expressions.py:1.36 PageTemplate.py:1.25 PageTemplateFile.py:1.19 PathIterator.py:1.4 PythonExpr.py:1.8 TALES.py:1.31 ZPythonExpr.py:1.8 ZRPythonExpr.py:1.10 ZopePageTemplate.py:1.42 __init__.py:1.4

Martijn Pieters mj@zope.com
Wed, 14 Aug 2002 18:17:56 -0400


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

Modified Files:
	Expressions.py PageTemplate.py PageTemplateFile.py 
	PathIterator.py PythonExpr.py TALES.py ZPythonExpr.py 
	ZRPythonExpr.py ZopePageTemplate.py __init__.py 
Log Message:
Clean up indentation and trailing whitespace.


=== Zope/lib/python/Products/PageTemplates/Expressions.py 1.35 => 1.36 ===
--- Zope/lib/python/Products/PageTemplates/Expressions.py:1.35	Fri Apr 19 10:16:09 2002
+++ Zope/lib/python/Products/PageTemplates/Expressions.py	Wed Aug 14 18:17:24 2002
@@ -1,14 +1,14 @@
 ##############################################################################
 #
 # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-# 
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE
-# 
+#
 ##############################################################################
 
 """Page Template Expression Engine
@@ -196,7 +196,7 @@
     def __repr__(self):
         return '%s:%s' % (self._name, `self._s`)
 
-            
+
 _interp = re.compile(r'\$(%(n)s)|\${(%(n)s(?:/[^}]*)*)}' % {'n': NAME_RE})
 
 class StringExpr:
@@ -223,7 +223,7 @@
                 parts.append(exp)
             expr = ''.join(parts)
         self._expr = expr
-        
+
     def __call__(self, econtext):
         vvals = []
         for var in self._vars:
@@ -244,7 +244,7 @@
     def __init__(self, name, expr, compiler):
         self._s = expr = expr.lstrip()
         self._c = compiler.compile(expr)
-        
+
     def __call__(self, econtext):
         return not econtext.evaluateBoolean(self._c)
 
@@ -266,7 +266,7 @@
     def __init__(self, name, expr, compiler):
         self._s = expr = expr.lstrip()
         self._c = compiler.compile(expr)
-        
+
     def __call__(self, econtext):
         return DeferWrapper(self._c, econtext)
 
@@ -286,7 +286,7 @@
         if not securityManager.validateValue(self):
             raise Unauthorized, name
         path.pop(0)
-        
+
     path.reverse()
     validate = securityManager.validate
     object = self
@@ -313,7 +313,7 @@
         t=get(object, '__bobo_traverse__', N)
         if t is not N:
             o=t(REQUEST, name)
-                    
+
             container = None
             if has(o, 'im_self'):
                 container = o.im_self


=== Zope/lib/python/Products/PageTemplates/PageTemplate.py 1.24 => 1.25 ===
--- Zope/lib/python/Products/PageTemplates/PageTemplate.py:1.24	Fri Apr 19 10:16:09 2002
+++ Zope/lib/python/Products/PageTemplates/PageTemplate.py	Wed Aug 14 18:17:24 2002
@@ -1,14 +1,14 @@
 ##############################################################################
 #
 # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-# 
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE
-# 
+#
 ##############################################################################
 """Page Template module
 
@@ -31,7 +31,7 @@
 
 class PageTemplate(Base):
     "Page Templates using TAL, TALES, and METAL"
-     
+
     content_type = 'text/html'
     expand = 0
     _v_errors = ()
@@ -70,7 +70,7 @@
                 parent = getattr(self, 'aq_parent', None)
             c['root'] = self
         return c
-    
+
     def pt_render(self, source=0, extra_context={}):
         """Render this Page Template"""
         if not self._v_cooked:
@@ -106,7 +106,7 @@
             self.pt_render(source=1)
         except:
             return ('Macro expansion failed', '%s: %s' % sys.exc_info()[:2])
-        
+
     def pt_warnings(self):
         if not self._v_cooked:
             self._cook()
@@ -145,7 +145,7 @@
                 return ('%s\n Macro expansion failed\n %s\n-->\n%s' %
                         (self._error_start, "%s: %s" % sys.exc_info()[:2],
                          self._text) )
-                                  
+
         return ('%s\n %s\n-->\n%s' % (self._error_start,
                                       '\n '.join(self._v_errors),
                                       self._text))
@@ -203,4 +203,3 @@
         if e:
             w = list(w) + list(e)
         self.warnings = w
-


=== Zope/lib/python/Products/PageTemplates/PageTemplateFile.py 1.18 => 1.19 ===
--- Zope/lib/python/Products/PageTemplates/PageTemplateFile.py:1.18	Sun Jul 21 20:09:47 2002
+++ Zope/lib/python/Products/PageTemplates/PageTemplateFile.py	Wed Aug 14 18:17:24 2002
@@ -1,14 +1,14 @@
 ##############################################################################
 #
 # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-# 
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE
-# 
+#
 ##############################################################################
 """Filesystem Page Template module
 
@@ -32,7 +32,7 @@
 
 class PageTemplateFile(Script, PageTemplate, Traversable):
     "Zope wrapper for filesystem Page Template using TAL, TALES, and METAL"
-     
+
     meta_type = 'Page Template (File)'
 
     func_defaults = None


=== Zope/lib/python/Products/PageTemplates/PathIterator.py 1.3 => 1.4 ===
--- Zope/lib/python/Products/PageTemplates/PathIterator.py:1.3	Fri Apr 19 10:16:09 2002
+++ Zope/lib/python/Products/PageTemplates/PathIterator.py	Wed Aug 14 18:17:24 2002
@@ -1,14 +1,14 @@
 ##############################################################################
 #
 # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-# 
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE
-# 
+#
 ##############################################################################
 
 """Path Iterator


=== Zope/lib/python/Products/PageTemplates/PythonExpr.py 1.7 => 1.8 ===
--- Zope/lib/python/Products/PageTemplates/PythonExpr.py:1.7	Fri Apr 19 10:16:09 2002
+++ Zope/lib/python/Products/PageTemplates/PythonExpr.py	Wed Aug 14 18:17:24 2002
@@ -1,14 +1,14 @@
 ##############################################################################
 #
 # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-# 
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE
-# 
+#
 ##############################################################################
 
 """Generic Python Expression Handler
@@ -61,7 +61,7 @@
     def __call__(self, econtext):
         __traceback_info__ = self.expr
         f = self._f
-        f.func_globals.update(self._bind_used_names(econtext))        
+        f.func_globals.update(self._bind_used_names(econtext))
         return f()
 
     def __str__(self):
@@ -78,4 +78,3 @@
     def __call__(self, text):
         return self._handler(self._name, text,
                              self._econtext._engine)(self._econtext)
-


=== Zope/lib/python/Products/PageTemplates/TALES.py 1.30 => 1.31 ===
--- Zope/lib/python/Products/PageTemplates/TALES.py:1.30	Fri May 24 11:43:56 2002
+++ Zope/lib/python/Products/PageTemplates/TALES.py	Wed Aug 14 18:17:24 2002
@@ -1,14 +1,14 @@
 ##############################################################################
 #
 # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-# 
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE
-# 
+#
 ##############################################################################
 """TALES
 
@@ -132,7 +132,7 @@
             raise CompilerError, (
                 'Unrecognized expression type "%s".' % type)
         return handler(type, expr, self)
-    
+
     def getContext(self, contexts=None, **kwcontexts):
         if contexts is not None:
             if kwcontexts:
@@ -282,4 +282,3 @@
         return self._name, self._expr
     def __repr__(self):
         return '<SimpleExpr %s %s>' % (self._name, `self._expr`)
-


=== Zope/lib/python/Products/PageTemplates/ZPythonExpr.py 1.7 => 1.8 ===
--- Zope/lib/python/Products/PageTemplates/ZPythonExpr.py:1.7	Fri Apr 19 10:16:09 2002
+++ Zope/lib/python/Products/PageTemplates/ZPythonExpr.py	Wed Aug 14 18:17:24 2002
@@ -1,14 +1,14 @@
 ##############################################################################
 #
 # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-# 
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE
-# 
+#
 ##############################################################################
 
 """Old Zope-specific Python Expression Handler


=== Zope/lib/python/Products/PageTemplates/ZRPythonExpr.py 1.9 => 1.10 ===
--- Zope/lib/python/Products/PageTemplates/ZRPythonExpr.py:1.9	Fri Apr 19 10:16:09 2002
+++ Zope/lib/python/Products/PageTemplates/ZRPythonExpr.py	Wed Aug 14 18:17:24 2002
@@ -1,14 +1,14 @@
 ##############################################################################
 #
 # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-# 
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE
-# 
+#
 ##############################################################################
 
 """Zope-specific Python Expression Handler
@@ -39,12 +39,12 @@
                                   '\n'.join(err) )
         self._f_varnames = use.keys()
         self._code = code
-        
+
     def __call__(self, econtext):
         __traceback_info__ = self.expr
         code = self._code
         g = self._bind_used_names(econtext)
-        g.update(self._globals)        
+        g.update(self._globals)
         return eval(code, g, {})
 
 class _SecureModuleImporter:


=== Zope/lib/python/Products/PageTemplates/ZopePageTemplate.py 1.41 => 1.42 ===
--- Zope/lib/python/Products/PageTemplates/ZopePageTemplate.py:1.41	Fri Jun  7 16:27:58 2002
+++ Zope/lib/python/Products/PageTemplates/ZopePageTemplate.py	Wed Aug 14 18:17:24 2002
@@ -1,14 +1,14 @@
 ##############################################################################
 #
 # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-# 
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE
-# 
+#
 ##############################################################################
 """Zope Page Template module
 
@@ -48,7 +48,7 @@
 class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
                        Traversable, PropertyManager):
     "Zope wrapper for Page Template using TAL, TALES, and METAL"
-     
+
     if SUPPORTS_WEBDAV_LOCKS:
         __implements__ = (WriteLockInterface,)
 
@@ -117,7 +117,7 @@
         REQUEST.set('text', self.read()) # May not equal 'text'!
         message = "Saved changes."
         if getattr(self, '_v_warnings', None):
-            message = ("<strong>Warning:</strong> <i>%s</i>" 
+            message = ("<strong>Warning:</strong> <i>%s</i>"
                        % '<br>'.join(self._v_warnings))
         return self.pt_editForm(manage_tabs_message=message)
 
@@ -132,7 +132,7 @@
         if type(file) is not StringType:
             if not file: raise ValueError, 'File not specified'
             file = file.read()
-            
+
         self.write(file)
         message = 'Saved changes.'
         return self.pt_editForm(manage_tabs_message=message)
@@ -142,7 +142,7 @@
         """Change editing preferences."""
         szchh = {'Taller': 1, 'Shorter': -1, None: 0}
         szchw = {'Wider': 5, 'Narrower': -5, None: 0}
-        
+
         # The <textarea> can have dimensions expressed in percentages
         if type(width) is StringType and width.endswith('%'):
             cols = int(width[:-1])
@@ -157,7 +157,7 @@
         else: # Absolute width
             try: cols = int(width)
             except: cols = max(40, int(dtpref_cols) + szchw.get(width, 0))
-            
+
         try: rows = int(height)
         except: rows = max(1, int(dtpref_rows) + szchh.get(height, 0))
         e = (DateTime('GMT') + 365).rfc822()
@@ -244,7 +244,7 @@
             self.dav__simpleifhandler(REQUEST, RESPONSE, refresh=1)
         self.write(REQUEST.get('BODY', ''))
         RESPONSE.setStatus(204)
-        return RESPONSE        
+        return RESPONSE
 
     manage_FTPput = PUT
 
@@ -309,7 +309,7 @@
     def __before_publishing_traverse__(self, ob, request):
         if getattr(request, '_hacked_path', 0):
             request._hacked_path = 0
-    
+
     def __call__(self, REQUEST, RESPONSE):
         " "
         return self.document_src(REQUEST)
@@ -342,7 +342,7 @@
             zpt = ZopePageTemplate(id)
         else:
             zpt = ZopePageTemplate(id, file, headers.get('content_type'))
-            
+
         self._setObject(id, zpt)
 
         try:
@@ -368,4 +368,3 @@
         )
     context.registerHelp()
     context.registerHelpTitle('Zope Help')
-


=== Zope/lib/python/Products/PageTemplates/__init__.py 1.3 => 1.4 ===
--- Zope/lib/python/Products/PageTemplates/__init__.py:1.3	Wed Nov 28 10:51:01 2001
+++ Zope/lib/python/Products/PageTemplates/__init__.py	Wed Aug 14 18:17:24 2002
@@ -1,14 +1,14 @@
 ##############################################################################
 #
 # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-# 
+#
 # This software is subject to the provisions of the Zope Public License,
 # Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE
-# 
+#
 ##############################################################################
 __doc__='''Package wrapper for Page Templates