Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
c1b50358
Commit
c1b50358
authored
May 28, 2006
by
Philipp von Weitershausen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup (shorter name, better docstring)
parent
a9f0860f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
lib/python/Products/PageTemplates/Expressions.py
lib/python/Products/PageTemplates/Expressions.py
+9
-6
No files found.
lib/python/Products/PageTemplates/Expressions.py
View file @
c1b50358
...
...
@@ -53,9 +53,12 @@ zope.deprecation.deprecated(
# Path Expression uses them
ZopeUndefs
=
Undefs
+
(
NotFound
,
Unauthorized
)
def
boboTraverseAwareSimpleTraverse
(
object
,
path_items
,
econtext
):
"""A slightly modified version of zope.tales.expressions.simpleTraverse
that interacts correctly with objects providing OFS.interfaces.ITraversable.
def
boboAwareZopeTraverse
(
object
,
path_items
,
econtext
):
"""Traverses a sequence of names, first trying attributes then items.
This uses Zope 3 path traversal where possible and interacts
correctly with objects providing OFS.interface.ITraversable when
necessary (bobo-awareness).
"""
request
=
getattr
(
econtext
,
'request'
,
None
)
path_items
=
list
(
path_items
)
...
...
@@ -97,7 +100,7 @@ class ZopePathExpr(PathExpr):
def
__init__
(
self
,
name
,
expr
,
engine
):
super
(
ZopePathExpr
,
self
).
__init__
(
name
,
expr
,
engine
,
bobo
TraverseAwareSimpl
eTraverse
)
bobo
AwareZop
eTraverse
)
# override this to support different call metrics (see bottom of
# method) and Zope 2's traversal exceptions (ZopeUndefs instead of
...
...
@@ -232,8 +235,8 @@ class PathIterator(ZopeIterator):
if
isinstance
(
name
,
basestring
):
name
=
name
.
split
(
'/'
)
try
:
ob1
=
bobo
TraverseAwareSimpl
eTraverse
(
ob1
,
name
,
None
)
ob2
=
bobo
TraverseAwareSimpl
eTraverse
(
ob2
,
name
,
None
)
ob1
=
bobo
AwareZop
eTraverse
(
ob1
,
name
,
None
)
ob2
=
bobo
AwareZop
eTraverse
(
ob2
,
name
,
None
)
except
LookupError
:
return
False
return
ob1
==
ob2
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment