Commit 764ccda5 authored by Evan Simpson's avatar Evan Simpson

Collector #1095: Allow TAL paths starting with '/varname' as a

preferred spelling for 'CONTEXTS/varname'.
parent 68249531
...@@ -33,6 +33,9 @@ Zope Changes ...@@ -33,6 +33,9 @@ Zope Changes
(such as storages, databases, or logging handlers) to be used. (such as storages, databases, or logging handlers) to be used.
Bugs fixed Bugs fixed
- Collector #1095: Allow TAL paths starting with '/varname' as a
preferred spelling for 'CONTEXTS/varname'.
- Collector #391: Cut and paste now requires delete permissions. - Collector #391: Cut and paste now requires delete permissions.
- Collector #331: Referenses to URL in manage_tabs was changed - Collector #331: Referenses to URL in manage_tabs was changed
......
...@@ -17,7 +17,7 @@ Page Template-specific implementation of TALES, with handlers ...@@ -17,7 +17,7 @@ Page Template-specific implementation of TALES, with handlers
for Python expressions, string literals, and paths. for Python expressions, string literals, and paths.
""" """
__version__='$Revision: 1.43 $'[11:-2] __version__='$Revision: 1.44 $'[11:-2]
import re, sys import re, sys
from TALES import Engine, CompilerError, _valid_name, NAME_RE, \ from TALES import Engine, CompilerError, _valid_name, NAME_RE, \
...@@ -115,7 +115,7 @@ class SubPathExpr: ...@@ -115,7 +115,7 @@ class SubPathExpr:
def __init__(self, path): def __init__(self, path):
self._path = path = path.strip().split('/') self._path = path = path.strip().split('/')
self._base = base = path.pop(0) 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 raise CompilerError, 'Invalid variable name "%s"' % base
# Parse path # Parse path
self._dp = dp = [] self._dp = dp = []
...@@ -140,7 +140,7 @@ class SubPathExpr: ...@@ -140,7 +140,7 @@ class SubPathExpr:
# of path names. # of path names.
path[i:i+1] = list(val) path[i:i+1] = list(val)
__traceback_info__ = base = self._base __traceback_info__ = base = self._base
if base == 'CONTEXTS': if base == 'CONTEXTS' or not base:
ob = econtext.contexts ob = econtext.contexts
else: else:
ob = vars[base] ob = vars[base]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment