summaryrefslogtreecommitdiff
path: root/repoze/bfg/events.py
diff options
context:
space:
mode:
Diffstat (limited to 'repoze/bfg/events.py')
-rw-r--r--repoze/bfg/events.py11
1 files changed, 11 insertions, 0 deletions
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