view contenttransformer/factory.py @ 19:afd11b758da0

just require genshi for now
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 27 Oct 2010 09:09:37 -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)