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
8bf9bc2d
Commit
8bf9bc2d
authored
Sep 15, 2007
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Collector #2352: fix in OFS.Traversable
parent
a046edbe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
11 deletions
+18
-11
doc/CHANGES.txt
doc/CHANGES.txt
+2
-0
lib/python/OFS/Traversable.py
lib/python/OFS/Traversable.py
+10
-10
lib/python/OFS/tests/testTraverse.py
lib/python/OFS/tests/testTraverse.py
+6
-1
No files found.
doc/CHANGES.txt
View file @
8bf9bc2d
...
@@ -8,6 +8,8 @@ Zope Changes
...
@@ -8,6 +8,8 @@ Zope Changes
Bugs fixed
Bugs fixed
- Collector #2352: fix in OFS.Traversable
- Collector #2346: username logging in FCGI crashed the server
- Collector #2346: username logging in FCGI crashed the server
- ZopePageTemplate's pt_edit did not recognize content type arguments
- ZopePageTemplate's pt_edit did not recognize content type arguments
...
...
lib/python/OFS/Traversable.py
View file @
8bf9bc2d
...
@@ -186,18 +186,18 @@ class Traversable:
...
@@ -186,18 +186,18 @@ class Traversable:
bobo_traverse
=
getattr
(
obj
,
'__bobo_traverse__'
,
None
)
bobo_traverse
=
getattr
(
obj
,
'__bobo_traverse__'
,
None
)
try
:
try
:
if
name
and
name
[:
1
]
in
'@+'
and
name
!=
'+'
:
if
name
and
name
[:
1
]
in
'@+'
and
name
!=
'+'
and
nsParse
(
name
)[
1
]
:
# Process URI segment parameters.
# Process URI segment parameters.
ns
,
nm
=
nsParse
(
name
)
ns
,
nm
=
nsParse
(
name
)
if
ns
:
try
:
try
:
next
=
namespaceLookup
(
n
ext
=
namespaceLookup
(
n
s
,
nm
,
obj
,
self
.
REQUEST
).
__of__
(
obj
)
ns
,
nm
,
obj
,
self
.
REQUEST
).
__of__
(
obj
)
if
restricted
and
not
validate
(
if
restricted
and
not
validate
(
obj
,
obj
,
name
,
next
):
obj
,
obj
,
name
,
next
):
raise
Unauthorized
(
name
)
raise
Unauthorized
(
name
)
except
TraversalError
:
except
TraversalError
:
raise
AttributeError
(
name
)
raise
AttributeError
(
name
)
elif
bobo_traverse
is
not
None
:
elif
bobo_traverse
is
not
None
:
next
=
bobo_traverse
(
REQUEST
,
name
)
next
=
bobo_traverse
(
REQUEST
,
name
)
if
restricted
:
if
restricted
:
...
...
lib/python/OFS/tests/testTraverse.py
View file @
8bf9bc2d
...
@@ -169,6 +169,7 @@ class TestTraverse( unittest.TestCase ):
...
@@ -169,6 +169,7 @@ class TestTraverse( unittest.TestCase ):
self
.
app
=
makerequest
(
self
.
root
,
stdout
=
responseOut
)
self
.
app
=
makerequest
(
self
.
root
,
stdout
=
responseOut
)
manage_addFolder
(
self
.
app
,
'folder1'
)
manage_addFolder
(
self
.
app
,
'folder1'
)
folder1
=
getattr
(
self
.
app
,
'folder1'
)
folder1
=
getattr
(
self
.
app
,
'folder1'
)
setattr
(
folder1
,
'+something'
,
'plus'
)
folder1
.
all_meta_types
=
\
folder1
.
all_meta_types
=
\
(
{
'name'
:
'File'
(
{
'name'
:
'File'
...
@@ -378,7 +379,11 @@ class TestTraverse( unittest.TestCase ):
...
@@ -378,7 +379,11 @@ class TestTraverse( unittest.TestCase ):
self
.
failUnless
(
self
.
failUnless
(
aq_base
(
self
.
root
.
folder1
.
file
.
restrictedTraverse
(
'../..'
))
is
aq_base
(
self
.
root
.
folder1
.
file
.
restrictedTraverse
(
'../..'
))
is
aq_base
(
self
.
root
))
aq_base
(
self
.
root
))
def
testTraverseToNameStartingWithPlus
(
self
):
# Verify it's possible to traverse to a name such as +something
self
.
failUnless
(
self
.
folder1
.
unrestrictedTraverse
(
'+something'
)
is
'plus'
)
import
os
,
sys
import
os
,
sys
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
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