comparison MoinMoin/wsgiapp.py @ 4256:c9483e402491

Wrap request only if it's not already a Context-object
author Florian Krupicka <florian.krupicka@googlemail.com>
date Thu, 31 Jul 2008 15:59:57 +0200
parents 3c6e893424f6
children e1a63fb9bb4d
comparison
equal deleted inserted replaced
4255:9d1817e8140b 4256:c9483e402491
23 def init(request): 23 def init(request):
24 """ 24 """
25 Wraps an incoming WSGI request in a Context object and initializes 25 Wraps an incoming WSGI request in a Context object and initializes
26 several important attributes. 26 several important attributes.
27 """ 27 """
28 context = AllContext(request) 28 if isinstance(request, Context):
29 context, request = request, request.request
30 else:
31 context = AllContext(request)
29 context.clock.start('total') 32 context.clock.start('total')
30 context.clock.start('init') 33 context.clock.start('init')
31 34
32 context.lang = setup_i18n_preauth(context) 35 context.lang = setup_i18n_preauth(context)
33 36