view contenttransformer/factory.py @ 9:051d4d39b4b9

* separate out get_response to its own function * keep track of raw content_type for later usage (muahaha)
author k0s <k0scist@gmail.com>
date Sun, 07 Feb 2010 19:03:15 -0500
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)