Mercurial > hg > contenttransformer
view contenttransformer/factory.py @ 0:29805d442afc
initial commit of contenttransformer; still in the stub stage
author | k0s <k0scist@gmail.com> |
---|---|
date | Mon, 11 Jan 2010 11:32:24 -0500 |
parents | |
children | aa491070ccf3 |
line wrap: on
line source
from dispatcher import Dispatcher from paste.httpexceptions import HTTPExceptionHandler def factory(global_conf, **app_conf): """create a webob view and wrap it in middleware""" keystr = 'typetransformer.' 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)