Mercurial > hg > webcalc
annotate 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 |
rev | line source |
---|---|
0 | 1 from webcalc import WebcalcView |
2 from paste.httpexceptions import HTTPExceptionHandler | |
3 | |
4 def factory(global_conf, **app_conf): | |
5 """create a webob view and wrap it in middleware""" | |
6 keystr = 'webcalc.' | |
7 args = dict([(key.split(keystr, 1)[-1], value) | |
8 for key, value in app_conf.items() | |
9 if key.startswith(keystr) ]) | |
10 app = WebcalcView(**args) | |
11 return HTTPExceptionHandler(app) | |
12 |