comparison MoinMoin/wsgiapp.py @ 4151:30ac757e72de

Added HTTPException catching middleware
author Florian Krupicka <florian.krupicka@googlemail.com>
date Sun, 08 Jun 2008 18:27:07 +0200
parents 769850545997
children ddcd459c3255
comparison
equal deleted inserted replaced
4150:72604cb46155 4151:30ac757e72de
10 from werkzeug.wrappers import Response 10 from werkzeug.wrappers import Response
11 from werkzeug.exceptions import NotFound 11 from werkzeug.exceptions import NotFound
12 12
13 from MoinMoin.web.contexts import HTTPContext 13 from MoinMoin.web.contexts import HTTPContext
14 from MoinMoin.web.utils import check_spider, handle_auth_form 14 from MoinMoin.web.utils import check_spider, handle_auth_form
15 from MoinMoin.web.apps import HTTPExceptionsMiddleware
15 16
16 from MoinMoin.Page import Page 17 from MoinMoin.Page import Page
17 from MoinMoin import config, wikiutil, user, caching, error 18 from MoinMoin import config, wikiutil, user, caching, error
18 from MoinMoin.action import get_names, get_available_actions 19 from MoinMoin.action import get_names, get_available_actions
19 from MoinMoin.config import multiconfig 20 from MoinMoin.config import multiconfig
31 request.clock.start('load_multi_cfg') 32 request.clock.start('load_multi_cfg')
32 request.cfg = multiconfig.getConfig(request.url) 33 request.cfg = multiconfig.getConfig(request.url)
33 request.clock.stop('load_multi_cfg') 34 request.clock.stop('load_multi_cfg')
34 except error.NoConfigMatchedError: 35 except error.NoConfigMatchedError:
35 raise NotFound('<p>No wiki configuration matching the URL found!</p>') 36 raise NotFound('<p>No wiki configuration matching the URL found!</p>')
36 37
37 request.isSpiderAgent = check_spider(request.user_agent, request.cfg) 38 request.isSpiderAgent = check_spider(request.user_agent, request.cfg)
38 39
39 request.action = request.form.get('action', 'show') 40 request.action = request.form.get('action', 'show')
40 41
41 try: 42 try:
110 else: 111 else:
111 response.response = request.output() 112 response.response = request.output()
112 return response 113 return response
113 114
114 application = responder(application) 115 application = responder(application)
116 application = HTTPExceptionsMiddleware(application)