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/push.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'repoze/bfg/push.py') diff --git a/repoze/bfg/push.py b/repoze/bfg/push.py index abc81adb5..928b25280 100644 --- a/repoze/bfg/push.py +++ b/repoze/bfg/push.py @@ -1,8 +1,17 @@ import os.path + from repoze.bfg.chameleon_zpt import render_template_to_response +try: + from functools import wraps +except ImportError: + # < 2.5 + from repoze.bfg.functional import wraps + class pushpage(object): - """ Decorator for functions which return Chameleon template namespaces. + """ Decorator for a function which returns a response object after + running the namespace the wrapped function returns through a + Chameleon ZPT template. E.g.:: @@ -27,7 +36,4 @@ class pushpage(object): def _curried(context, request): kw = wrapped(context, request) return render_template_to_response(path, **kw) - _curried.__name__ = wrapped.__name__ - _curried.__grok_module__ = wrapped.__module__ # r.bfg.convention support - - return _curried + return wraps(wrapped)(_curried) # pickleability and grokkability -- cgit v1.2.3