Mercurial > hg > webcalc
view webcalc/factory.py @ 0:1eea6356d2e5
initial import of webcalc
author | k0s <k0scist@gmail.com> |
---|---|
date | Mon, 07 Sep 2009 15:09:03 -0400 |
parents | |
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)