diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-01-16 18:58:16 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-01-16 18:58:16 +0000 |
| commit | 5a7f9a4d57424f14a1e072cc06b6bf7a191a7d08 (patch) | |
| tree | b44448198ddf8031b3e09b83dd731f2ae1d6623a /repoze/bfg/push.py | |
| parent | 4856cc54bcd5feb97db49f1cca923afb01c0bf02 (diff) | |
| download | pyramid-5a7f9a4d57424f14a1e072cc06b6bf7a191a7d08.tar.gz pyramid-5a7f9a4d57424f14a1e072cc06b6bf7a191a7d08.tar.bz2 pyramid-5a7f9a4d57424f14a1e072cc06b6bf7a191a7d08.zip | |
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
``<convention package=".">`` to ``<grok package=".">``. 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.
Diffstat (limited to 'repoze/bfg/push.py')
| -rw-r--r-- | repoze/bfg/push.py | 16 |
1 files changed, 11 insertions, 5 deletions
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 |
