From faaebc304a29308a98b22d8fc56c500b018b6c90 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 29 Aug 2008 18:48:48 +0000 Subject: Rejigger and document wsgi app created event. --- repoze/bfg/events.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'repoze/bfg/events.py') diff --git a/repoze/bfg/events.py b/repoze/bfg/events.py index 3253f1380..b43fd5753 100644 --- a/repoze/bfg/events.py +++ b/repoze/bfg/events.py @@ -2,6 +2,7 @@ from zope.interface import implements from repoze.bfg.interfaces import INewRequest from repoze.bfg.interfaces import INewResponse +from repoze.bfg.interfaces import IWSGIApplicationCreatedEvent class NewRequest(object): """ An instance of this class is emitted as an event whenever @@ -21,3 +22,13 @@ class NewResponse(object): implements(INewResponse) def __init__(self, response): self.response = response + +class WSGIApplicationCreatedEvent(object): + """ An instance of this class is emitted as an event whenever a + ``repoze.bfg`` application starts. The instance has an attribute, + ``app``, which is an instance of the ``repoze.bfg.router.Router`` + class that will handle WSGI requests. This class implements the + ``repoze.bfg.interfaces.IWSGIApplicationCreatedEvent`` interface.""" + implements(IWSGIApplicationCreatedEvent) + def __init__(self, app): + self.app = app -- cgit v1.2.3