Merge lp:~lifeless/zope.publisher/start-request-event into lp:zope.publisher

Proposed by Robert Collins
Status: Merged
Merge reported by: Robert Collins
Merged at revision: not available
Proposed branch: lp:~lifeless/zope.publisher/start-request-event
Merge into: lp:zope.publisher
Diff against target: 82 lines (+37/-9)
2 files modified
CHANGES.txt (+4/-0)
src/zope/publisher/interfaces/__init__.py (+33/-9)
To merge this branch: bzr merge lp:~lifeless/zope.publisher/start-request-event
Reviewer Review Type Date Requested Status
ZTK steering group Pending
Review via email: mp+28558@code.launchpad.net

Description of the change

EndRequest events are nice, StartRequest events would be nice too. As tested as EndRequest (that is not at all :().

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :
Revision history for this message
Tres Seaver (tseaver) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Collins wrote:
> Robert Collins has proposed merging lp:~lifeless/zope.publisher/start-request-event into lp:zope.publisher.
>
> Requested reviews:
> ZTK steering group (ztk-steering-group)
>
>
> EndRequest events are nice, StartRequest events would be nice too. As tested as EndRequest (that is not at all :().
>

 +1

I presume that there is a correlated branch for zope.app.publication
which actually emits the new events.

Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 <email address hidden>
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkwmEkkACgkQ+gerLs4ltQ6z0gCgg5ZR0umpljBYIUgcdKTFKMc+
vyUAn0bo4rhrdB310cj9U+jtOgMkeFkl
=1DXE
-----END PGP SIGNATURE-----

Revision history for this message
Robert Collins (lifeless) wrote :

There would be but I couldn't find a bzr import of zope.app.publication, so I've done a regular patch, filed a bug for zope.app.publication and filed it at https://bugs.edge.launchpad.net/zope.app.publication/+bug/598816.

Revision history for this message
Robert Collins (lifeless) wrote :

Benji says this has been applied.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CHANGES.txt'
--- CHANGES.txt 2010-06-10 05:26:47 +0000
+++ CHANGES.txt 2010-06-26 12:34:24 +0000
@@ -6,6 +6,10 @@
66
7- LP #131460: Make principal logging unicode safe.7- LP #131460: Make principal logging unicode safe.
8- Remove use of string exceptions in tests, http://bugs.debian.org/5853438- Remove use of string exceptions in tests, http://bugs.debian.org/585343
9- Add IStartRequestEvent and StartRequestEvent for using in
10 zope.app.publication (matching up with IEndRequestEvent and EndRequestEvent).
11 This included refactoring to produce one definition of 'event with a request'
12 - IRequestEvent.
913
103.12.3 (2010-04-30)143.12.3 (2010-04-30)
11-------------------15-------------------
1216
=== modified file 'src/zope/publisher/interfaces/__init__.py'
--- src/zope/publisher/interfaces/__init__.py 2010-06-03 16:27:40 +0000
+++ src/zope/publisher/interfaces/__init__.py 2010-06-26 12:34:24 +0000
@@ -463,18 +463,44 @@
463 """463 """
464464
465465
466class IEndRequestEvent(Interface):466class IRequestEvent(Interface):
467 """An event which gets sent when the publication is ended"""467 """An event which is about or for a request."""
468468
469469 request = Attribute("The request this event is about.")
470class EndRequestEvent(object):470
471
472class IEndRequestEvent(IRequestEvent):
473 """An event which gets sent when the publication is ended."""
474
475
476class IStartRequestEvent(IRequestEvent):
477 """An event which gets sent before publication of a request."""
478
479
480class RequestEvent(object):
481 """Events for requests.
482
483 :ivar request: The request the event is for.
484 """
485
486 def __init__(self, request):
487 self.request = request
488
489
490class EndRequestEvent(RequestEvent):
471 """An event which gets sent when the publication is ended"""491 """An event which gets sent when the publication is ended"""
472492
473 implements(IEndRequestEvent)493 implements(IEndRequestEvent)
474494
475 def __init__(self, ob, request):495 def __init__(self, ob, request):
496 super(EndRequestEvent, self).__init__(request)
476 self.object = ob497 self.object = ob
477 self.request = request498
499
500class StartRequestEvent(RequestEvent):
501 """An event send when before publication of a request."""
502
503 implements(IStartRequestEvent)
478504
479505
480class ISkinType(IInterface):506class ISkinType(IInterface):
@@ -497,11 +523,9 @@
497 """523 """
498524
499525
500class ISkinChangedEvent(Interface):526class ISkinChangedEvent(IRequestEvent):
501 """Event that gets triggered when the skin of a request is changed."""527 """Event that gets triggered when the skin of a request is changed."""
502528
503 request = Attribute("The request for which the skin was changed.")
504
505529
506530
507class IDefaultViewName(Interface):531class IDefaultViewName(Interface):

Subscribers

People subscribed via source and target branches