annotate uploader/factory.py @ 0:827f7577f940

initial commit of file upload widget
author k0s <k0scist@gmail.com>
date Sat, 21 Nov 2009 15:29:03 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
827f7577f940 initial commit of file upload widget
k0s <k0scist@gmail.com>
parents:
diff changeset
1 from dispatcher import Dispatcher
827f7577f940 initial commit of file upload widget
k0s <k0scist@gmail.com>
parents:
diff changeset
2 from paste.httpexceptions import HTTPExceptionHandler
827f7577f940 initial commit of file upload widget
k0s <k0scist@gmail.com>
parents:
diff changeset
3
827f7577f940 initial commit of file upload widget
k0s <k0scist@gmail.com>
parents:
diff changeset
4 def factory(global_conf, **app_conf):
827f7577f940 initial commit of file upload widget
k0s <k0scist@gmail.com>
parents:
diff changeset
5 """create a webob view and wrap it in middleware"""
827f7577f940 initial commit of file upload widget
k0s <k0scist@gmail.com>
parents:
diff changeset
6 keystr = 'uploader.'
827f7577f940 initial commit of file upload widget
k0s <k0scist@gmail.com>
parents:
diff changeset
7 args = dict([(key.split(keystr, 1)[-1], value)
827f7577f940 initial commit of file upload widget
k0s <k0scist@gmail.com>
parents:
diff changeset
8 for key, value in app_conf.items()
827f7577f940 initial commit of file upload widget
k0s <k0scist@gmail.com>
parents:
diff changeset
9 if key.startswith(keystr) ])
827f7577f940 initial commit of file upload widget
k0s <k0scist@gmail.com>
parents:
diff changeset
10 app = Dispatcher(**args)
827f7577f940 initial commit of file upload widget
k0s <k0scist@gmail.com>
parents:
diff changeset
11 return HTTPExceptionHandler(app)
827f7577f940 initial commit of file upload widget
k0s <k0scist@gmail.com>
parents:
diff changeset
12