comparison redirectall/factory.py @ 1:3117c5556eca default tip

update redirectall
author Jeff Hammel <jhammel@mozilla.com>
date Sun, 08 May 2011 19:14:21 -0700
parents 9e2187433034
children
comparison
equal deleted inserted replaced
0:9e2187433034 1:3117c5556eca
1 from dispatcher import Dispatcher 1 from dispatcher import RedirectAll
2 from paste.httpexceptions import HTTPExceptionHandler
3 2
4 def factory(global_conf, **app_conf): 3 def factory(global_conf, **app_conf):
5 """create a webob view and wrap it in middleware""" 4 """create a webob view and wrap it in middleware"""
6 keystr = 'redirectall.' 5 keystr = 'redirectall.'
7 args = dict([(key.split(keystr, 1)[-1], value) 6 args = dict([(key.split(keystr, 1)[-1], value)
8 for key, value in app_conf.items() 7 for key, value in app_conf.items()
9 if key.startswith(keystr) ]) 8 if key.startswith(keystr) ])
10 app = Dispatcher(**args) 9 return RedirectAll(**args)
11 return HTTPExceptionHandler(app)
12 10