view webcalc/factory.py @ 1:12ac99c240ca default tip

* add documentation * add 1..10 autostep feature * bump version
author Jeff Hammel <k0scist@gmail.com>
date Wed, 10 Mar 2010 17:48:11 -0500
parents 1eea6356d2e5
children
line wrap: on
line source

from webcalc import WebcalcView
from paste.httpexceptions import HTTPExceptionHandler

def factory(global_conf, **app_conf):
    """create a webob view and wrap it in middleware"""
    keystr = 'webcalc.'
    args = dict([(key.split(keystr, 1)[-1], value)
                 for key, value in app_conf.items()
                 if key.startswith(keystr) ])
    app = WebcalcView(**args)
    return HTTPExceptionHandler(app)