Mercurial > hg > webob_view
comparison webob_view/template/+package+/factory.py_tmpl @ 1:eb2cb7ebc849
moving to a handler architecture
author | k0s <k0scist@gmail.com> |
---|---|
date | Thu, 29 Oct 2009 15:08:54 -0400 |
parents | 72cb6dc31e3f |
children |
comparison
equal
deleted
inserted
replaced
0:72cb6dc31e3f | 1:eb2cb7ebc849 |
---|---|
1 from ${package} import View | 1 from dispatcher import Dispatcher |
2 from paste.httpexceptions import HTTPExceptionHandler | 2 from paste.httpexceptions import HTTPExceptionHandler |
3 | 3 |
4 def factory(global_conf, **app_conf): | 4 def factory(global_conf, **app_conf): |
5 """create a webob view and wrap it in middleware""" | 5 """create a webob view and wrap it in middleware""" |
6 keystr = '${project}.' | 6 keystr = '${project}.' |
7 args = dict([(key.split(keystr, 1)[-1], value) | 7 args = dict([(key.split(keystr, 1)[-1], value) |
8 for key, value in app_conf.items() | 8 for key, value in app_conf.items() |
9 if key.startswith(keystr) ]) | 9 if key.startswith(keystr) ]) |
10 app = View(**args) | 10 app = Dispatcher(**args) |
11 return HTTPExceptionHandler(app) | 11 return HTTPExceptionHandler(app) |
12 | 12 |