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
edfef192
Commit
edfef192
authored
Mar 08, 2004
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor tweak to post_traverse implementation and docstring.
parent
b4f27cf3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
lib/python/ZPublisher/BaseRequest.py
lib/python/ZPublisher/BaseRequest.py
+19
-9
No files found.
lib/python/ZPublisher/BaseRequest.py
View file @
edfef192
...
...
@@ -12,7 +12,7 @@
##############################################################################
""" Basic ZPublisher request management.
$Id: BaseRequest.py,v 1.5
5 2004/03/03 11:07:01 ctheune
Exp $
$Id: BaseRequest.py,v 1.5
6 2004/03/08 17:37:05 evan
Exp $
"""
from
urllib
import
quote
...
...
@@ -455,20 +455,30 @@ class BaseRequest:
# Remove http request method from the URL.
request
[
'URL'
]
=
URL
# Run post traversal hooks here
result
=
None
# Run post traversal hooks
if
post_traverse
:
result
=
exec_callables
(
post_traverse
)
if
result
is
not
None
:
object
=
result
if
result
is
not
None
:
object
=
result
return
object
def
post_traverse
(
self
,
f
,
args
=
()):
"""Set a callable object and argument tuple to be combined if traversal succeeds."""
if
hasattr
(
self
,
"_post_traverse"
):
self
.
_post_traverse
.
append
((
f
,
tuple
(
args
)))
"""Add a callable object and argument tuple to be post-traversed.
If traversal and authentication succeed, each post-traversal
pair is processed in the order in which they were added.
Each argument tuple is passed to its callable. If a callable
returns a value other than None, no more pairs are processed,
and the return value replaces the traversal result.
"""
try
:
pairs
=
self
.
_post_traverse
except
AttributeError
:
raise
RuntimeError
,
(
'post_traverse() may only be called '
'during publishing traversal.'
)
else
:
pairs
.
append
((
f
,
tuple
(
args
)))
retry_count
=
0
def
supports_retry
(
self
):
return
0
...
...
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