Mercurial > hg > contenttransformer
view contenttransformer/factory.py @ 13:9d51954e2e68
allow transformers to take kwargs
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Wed, 30 Jun 2010 22:09:13 -0700 |
parents | aa491070ccf3 |
children |
line wrap: on
line source
from web import Dispatcher from paste.httpexceptions import HTTPExceptionHandler def factory(global_conf, **app_conf): """create a webob view and wrap it in middleware""" keystr = 'transformer.' args = dict([(key.split(keystr, 1)[-1], value) for key, value in app_conf.items() if key.startswith(keystr) ]) app = Dispatcher(**args) return HTTPExceptionHandler(app)