annotate uploader/factory.py @ 3:bb2d34fb5de4
allow to be used as middleware
author |
k0s <k0scist@gmail.com> |
date |
Sun, 27 Dec 2009 16:27:34 -0500 |
parents |
827f7577f940 |
children |
|
rev |
line source |
0
|
1 from dispatcher import Dispatcher
|
|
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 = 'uploader.'
|
|
7 args = dict([(key.split(keystr, 1)[-1], value)
|
|
8 for key, value in app_conf.items()
|
|
9 if key.startswith(keystr) ])
|
|
10 app = Dispatcher(**args)
|
|
11 return HTTPExceptionHandler(app)
|
|
12
|