Mercurial > hg > uploader
view uploader/factory.py @ 15:1ee374416987
handle more gracefully when no file is uploaded
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Tue, 12 Jul 2011 09:18:29 -0700 |
parents | 827f7577f940 |
children |
line wrap: on
line source
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)