From 5a7f9a4d57424f14a1e072cc06b6bf7a191a7d08 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 16 Jan 2009 18:58:16 +0000 Subject: Features -------- - The functionality of ``repoze.bfg.convention`` has been merged into the core. Applications which make use of ``repoze.bfg.convention`` will continue to work indefinitely, but it is recommended that apps stop depending upon it. To do so, substitute imports of ``repoze.bfg.convention.bfg_view`` with imports of ``repoze.bfg.view.bfg_view``, and change the stanza in ZCML from ```` to ````. As a result of the merge, bfg has grown a new dependency: ``martian``. - View functions which use the pushpage decorator are now pickleable (meaning their use won't prevent a ``configure.zcml.cache`` file from being written to disk). Implementation Changes ---------------------- - The ``wsgiapp`` decorator now uses ``webob.Request.get_response`` to do its work rather than relying on howgrown WSGI code. --- repoze/bfg/wsgi.py | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'repoze/bfg/wsgi.py') diff --git a/repoze/bfg/wsgi.py b/repoze/bfg/wsgi.py index 93b2c143b..b0feef29e 100644 --- a/repoze/bfg/wsgi.py +++ b/repoze/bfg/wsgi.py @@ -1,8 +1,3 @@ -from zope.component import queryUtility - -from repoze.bfg.interfaces import IResponseFactory - -from webob import Response try: from functools import wraps except ImportError: @@ -34,20 +29,5 @@ def wsgiapp(wrapped): WSGI app were a repoze.bfg view. """ def decorator(context, request): - caught = [] - def catch_start_response(status, headers, exc_info=None): - caught[:] = (status, headers, exc_info) - environ = request.environ - body = wrapped(environ, catch_start_response) - if caught: - status, headers, exc_info = caught - response_factory = queryUtility(IResponseFactory, default=Response) - response = response_factory() - response.app_iter = body - response.status = status - response.headerlist = headers - return response - else: - raise RuntimeError('WSGI start_response not called') - return wraps(wrapped)(decorator) # for pickleability - + return request.get_response(wrapped) + return wraps(wrapped)(decorator) # pickleability -- cgit v1.2.3