Mercurial > hg > webcalc
diff 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 diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/webcalc/factory.py Mon Sep 07 15:09:03 2009 -0400 @@ -0,0 +1,12 @@ +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) +