diff options
| author | Chris McDonough <chrism@agendaless.com> | 2008-08-29 18:48:48 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2008-08-29 18:48:48 +0000 |
| commit | faaebc304a29308a98b22d8fc56c500b018b6c90 (patch) | |
| tree | a5e3430eecff3fa11ea7cee6c15dbfccaecaa08f /repoze | |
| parent | 770ee43de26fbd04c27f32121d2a4a1138c93d82 (diff) | |
| download | pyramid-faaebc304a29308a98b22d8fc56c500b018b6c90.tar.gz pyramid-faaebc304a29308a98b22d8fc56c500b018b6c90.tar.bz2 pyramid-faaebc304a29308a98b22d8fc56c500b018b6c90.zip | |
Rejigger and document wsgi app created event.
Diffstat (limited to 'repoze')
| -rw-r--r-- | repoze/bfg/events.py | 11 | ||||
| -rw-r--r-- | repoze/bfg/interfaces.py | 6 | ||||
| -rw-r--r-- | repoze/bfg/router.py | 3 |
3 files changed, 13 insertions, 7 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 diff --git a/repoze/bfg/interfaces.py b/repoze/bfg/interfaces.py index d1a8fc63a..db2d1622d 100644 --- a/repoze/bfg/interfaces.py +++ b/repoze/bfg/interfaces.py @@ -92,9 +92,3 @@ class IWSGIApplicationCreatedEvent(IObjectEvent): configured.""" app = Attribute(u"Published application") - -class WSGIApplicationCreatedEvent(object): - implements(IWSGIApplicationCreatedEvent) - - def __init__(self, app): - self.app = app diff --git a/repoze/bfg/router.py b/repoze/bfg/router.py index 32e5b4b4d..3b4d16d8e 100644 --- a/repoze/bfg/router.py +++ b/repoze/bfg/router.py @@ -10,12 +10,13 @@ from webob.exc import HTTPUnauthorized from repoze.bfg.events import NewRequest from repoze.bfg.events import NewResponse +from repoze.bfg.events import WSGIApplicationCreatedEvent + from repoze.bfg.interfaces import ITraverserFactory from repoze.bfg.interfaces import IView from repoze.bfg.interfaces import IViewPermission from repoze.bfg.interfaces import ISecurityPolicy from repoze.bfg.interfaces import IRequest -from repoze.bfg.interfaces import WSGIApplicationCreatedEvent from repoze.bfg.registry import registry_manager |
