diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uploader/factory.py	Sat Nov 21 15:29:03 2009 -0500
@@ -0,0 +1,12 @@
+from dispatcher import Dispatcher
+from paste.httpexceptions import HTTPExceptionHandler
+
+def factory(global_conf, **app_conf):
+    """create a webob view and wrap it in middleware"""
+    keystr = 'uploader.'
+    args = dict([(key.split(keystr, 1)[-1], value)
+                 for key, value in app_conf.items()
+                 if key.startswith(keystr) ])
+    app = Dispatcher(**args)
+    return HTTPExceptionHandler(app)
+