comparison MoinMoin/action/__init__.py @ 4183:fc20a076aad0

Accomodate for consolidation of Request/Response
author Florian Krupicka <florian.krupicka@googlemail.com>
date Sat, 21 Jun 2008 16:57:20 +0200
parents 85884c67228d
children 40acd13fb3d6
comparison
equal deleted inserted replaced
4182:ca0cf44dab89 4183:fc20a076aad0
243 """ 243 """
244 # We must check if the current page has different ACLs. 244 # We must check if the current page has different ACLs.
245 if not request.user.may.read(pagename): 245 if not request.user.may.read(pagename):
246 Page(request, pagename).send_page() 246 Page(request, pagename).send_page()
247 else: 247 else:
248 mimetype = request.form.get('mimetype', [u"text/html"])[0] 248 from MoinMoin.web.contexts import HTTPContext, RenderContext
249 mimetype = request.form.get('mimetype', u"text/html")
249 rev = request.rev or 0 250 rev = request.rev or 0
250 if rev == 0: 251 if rev == 0:
251 request.cacheable = cacheable 252 request.cacheable = cacheable
252 Page(request, pagename, rev=rev, formatter=mimetype).send_page( 253 Page(request, pagename, rev=rev, formatter=mimetype).send_page(
253 count_hit=count_hit, 254 count_hit=count_hit,
267 do_show(pagename, request, count_hit=0, cacheable=0) 268 do_show(pagename, request, count_hit=0, cacheable=0)
268 269
269 def do_content(pagename, request): 270 def do_content(pagename, request):
270 """ same as do_show, but we only show the content """ 271 """ same as do_show, but we only show the content """
271 # XXX temporary fix to make it work until Page.send_page gets refactored 272 # XXX temporary fix to make it work until Page.send_page gets refactored
272 request.response.mimetype = 'text/html' 273 request.mimetype = 'text/html'
273 request.response.status_code = 200 274 request.status_code = 200
274 do_show(pagename, request, count_hit=0, content_only=1) 275 do_show(pagename, request, count_hit=0, content_only=1)
275 276
276 def do_print(pagename, request): 277 def do_print(pagename, request):
277 """ same as do_show, but with print_mode set """ 278 """ same as do_show, but with print_mode set """
278 do_show(pagename, request, print_mode=1) 279 do_show(pagename, request, print_mode=1)