"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Products/PageTemplates/Expressions.py" between
Zope-5.1.2.tar.gz and Zope-5.2.tar.gz

About: Zope Z Object Publishing Environment - web application platform used for building content management systems, intranets, portals, and custom applications.

Expressions.py  (Zope-5.1.2):Expressions.py  (Zope-5.2)
skipping to change at line 20 skipping to change at line 20
# FOR A PARTICULAR PURPOSE # FOR A PARTICULAR PURPOSE
# #
############################################################################## ##############################################################################
"""Page Template Expression Engine """Page Template Expression Engine
Page Template-specific implementation of TALES, with handlers Page Template-specific implementation of TALES, with handlers
for Python expressions, string literals, and paths. for Python expressions, string literals, and paths.
""" """
import logging import logging
import warnings
import OFS.interfaces import OFS.interfaces
from AccessControl import safe_builtins from AccessControl import safe_builtins
from Acquisition import aq_base from Acquisition import aq_base
from MultiMapping import MultiMapping from MultiMapping import MultiMapping
from zExceptions import NotFound from zExceptions import NotFound
from zExceptions import Unauthorized from zExceptions import Unauthorized
from zope.component import queryUtility from zope.component import queryUtility
from zope.contentprovider.tales import TALESProviderExpression from zope.contentprovider.tales import TALESProviderExpression
from zope.i18n import translate from zope.i18n import translate
skipping to change at line 75 skipping to change at line 76
This uses zope.traversing path traversal where possible and interacts This uses zope.traversing path traversal where possible and interacts
correctly with objects providing OFS.interface.ITraversable when correctly with objects providing OFS.interface.ITraversable when
necessary (bobo-awareness). necessary (bobo-awareness).
""" """
request = getattr(econtext, 'request', None) request = getattr(econtext, 'request', None)
path_items = list(path_items) path_items = list(path_items)
path_items.reverse() path_items.reverse()
while path_items: while path_items:
name = path_items.pop() name = path_items.pop()
if name == '_':
warnings.warn('Traversing to the name `_` is deprecated '
'and will be removed in Zope 6.',
DeprecationWarning)
elif name.startswith('_'):
raise NotFound(name)
if OFS.interfaces.ITraversable.providedBy(object): if OFS.interfaces.ITraversable.providedBy(object):
object = object.restrictedTraverse(name) object = object.restrictedTraverse(name)
else: else:
object = traversePathElement(object, name, path_items, object = traversePathElement(object, name, path_items,
request=request) request=request)
return object return object
def trustedBoboAwareZopeTraverse(object, path_items, econtext): def trustedBoboAwareZopeTraverse(object, path_items, econtext):
"""Traverses a sequence of names, first trying attributes then items. """Traverses a sequence of names, first trying attributes then items.
 End of changes. 2 change blocks. 
0 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)