view clwapp/factory.py @ 0:196f241286f7

initial import of clwapp, from https://svn.openplans.org/svn/standalone/clwapp/trunk/
author k0s <k0scist@gmail.com>
date Sun, 01 Nov 2009 18:24:35 -0500
parents
children
line wrap: on
line source

from clwapp import View
from paste.httpexceptions import HTTPExceptionHandler

def factory(global_conf, **app_conf):
    """create a webob view and wrap it in middleware"""

    config = [ 'command' ]
    key_str = 'clwapp.%s'
    args = dict([(key, app_conf[ key_str % key]) for key in config
                 if app_conf.has_key(key_str % key) ])
    app = View(**args)
    return HTTPExceptionHandler(app)