Mercurial > hg > webob_view
view webob_view/template/+package+/factory.py_tmpl @ 0:72cb6dc31e3f
initial commit of webob_view from https://svn.openplans.org/svn/standalone/templates/webob_view/trunk/
author | k0s <k0scist@gmail.com> |
---|---|
date | Tue, 27 Oct 2009 15:04:33 -0400 |
parents | |
children | eb2cb7ebc849 |
line wrap: on
line source
from ${package} import View from paste.httpexceptions import HTTPExceptionHandler def factory(global_conf, **app_conf): """create a webob view and wrap it in middleware""" keystr = '${project}.' args = dict([(key.split(keystr, 1)[-1], value) for key, value in app_conf.items() if key.startswith(keystr) ]) app = View(**args) return HTTPExceptionHandler(app)