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
08717426
Commit
08717426
authored
May 24, 2012
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added PubStart, PubBeforeCommit and PubAfterTraversal events to the WSGI publisher.
parent
088ad442
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
doc/CHANGES.rst
doc/CHANGES.rst
+3
-0
src/ZPublisher/WSGIPublisher.py
src/ZPublisher/WSGIPublisher.py
+8
-2
No files found.
doc/CHANGES.rst
View file @
08717426
...
...
@@ -8,6 +8,9 @@ http://docs.zope.org/zope2/releases/.
2.13.14 (unreleased)
--------------------
- Added PubStart, PubBeforeCommit and PubAfterTraversal events to the
WSGI publisher.
- ZPublisher: Fixed a traversal regression introduced in 2.13.12.
- Updated distributions:
...
...
src/ZPublisher/WSGIPublisher.py
View file @
08717426
...
...
@@ -30,6 +30,7 @@ from ZPublisher.Publish import call_object
from
ZPublisher.Publish
import
dont_publish_class
from
ZPublisher.Publish
import
get_module_info
from
ZPublisher.Publish
import
missing_name
from
ZPublisher.pubevents
import
PubStart
,
PubBeforeCommit
,
PubAfterTraversal
from
ZPublisher.Iterators
import
IStreamIterator
_NOW
=
None
# overwrite for testing
...
...
@@ -149,6 +150,7 @@ class WSGIResponse(HTTPResponse):
# return ''
raise
NotImplementedError
def
publish
(
request
,
module_name
,
_get_module_info
=
get_module_info
,
# only for testing
):
...
...
@@ -160,8 +162,9 @@ def publish(request, module_name,
err_hook
,
validated_hook
,
transactions_manager
,
)
=
_get_module_info
(
module_name
)
)
=
_get_module_info
(
module_name
)
notify
(
PubStart
(
request
))
request
.
processInputs
()
response
=
request
.
response
...
...
@@ -181,8 +184,9 @@ def publish(request, module_name,
# According to RFC1738 a trailing space in the path is valid.
path
=
request
.
get
(
'PATH_INFO'
)
request
[
'PARENTS'
]
=
parents
=
[
object
]
request
[
'PARENTS'
]
=
[
object
]
object
=
request
.
traverse
(
path
,
validated_hook
=
validated_hook
)
notify
(
PubAfterTraversal
(
request
))
if
transactions_manager
:
transactions_manager
.
recordMetaData
(
object
,
request
)
...
...
@@ -201,8 +205,10 @@ def publish(request, module_name,
if
result
is
not
response
:
response
.
setBody
(
result
)
notify
(
PubBeforeCommit
(
request
))
return
response
class
_RequestCloserForTransaction
(
object
):
"""Unconditionally close the request at the end of a transaction.
...
...
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