[Zope-Checkins] CVS: Releases/Zope/lib/python/Products/PageTemplates - Expressions.py:1.44

Evan Simpson cvs-admin at zope.org
Tue Nov 4 14:36:06 EST 2003


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

Modified Files:
	Expressions.py 
Log Message:
Collector #1095: Allow TAL paths starting with '/varname' as a
preferred spelling for 'CONTEXTS/varname'.


=== Releases/Zope/lib/python/Products/PageTemplates/Expressions.py 1.43 => 1.44 ===
--- Releases/Zope/lib/python/Products/PageTemplates/Expressions.py:1.43	Thu Sep 26 17:33:17 2002
+++ Releases/Zope/lib/python/Products/PageTemplates/Expressions.py	Tue Nov  4 14:36:05 2003
@@ -115,7 +115,7 @@
     def __init__(self, path):
         self._path = path = path.strip().split('/')
         self._base = base = path.pop(0)
-        if not _valid_name(base):
+        if base and not _valid_name(base):
             raise CompilerError, 'Invalid variable name "%s"' % base
         # Parse path
         self._dp = dp = []
@@ -140,7 +140,7 @@
                     # of path names.
                     path[i:i+1] = list(val)
         __traceback_info__ = base = self._base
-        if base == 'CONTEXTS':
+        if base == 'CONTEXTS' or not base:
             ob = econtext.contexts
         else:
             ob = vars[base]




More information about the Zope-Checkins mailing list