Attachment 'refresh-1.1.py'

Download

   1 # -*- coding: iso-8859-1 -*-
   2 """
   3     MoinMoin - refresh cache of a page
   4 
   5     @copyright: 2000-2004 Juergen Hermann <jh@web.de>,
   6                 2006 MoinMoin:ThomasWaldmann
   7     @license: GNU GPL, see COPYING for details.
   8 """
   9 from MoinMoin.Page import Page
  10 
  11 def execute(pagename, request):
  12     """ Handle refresh action """
  13     # Without arguments, refresh action will refresh the page text_html cache.
  14     arena = request.values.get('arena', 'Page.py')
  15     if arena == 'Page.py':
  16         arena = Page(request, pagename)
  17     key = request.values.get('key', 'text_html')
  18 
  19     #[IanRiley 2017-08-31] get print option
  20     print_mode = request.values.get('print', '')
  21     if print_mode.lower() in ['1','t','true','y','yes']:
  22         print_mode = 1
  23     else:
  24         print_mode = 0
  25 
  26     # Remove cache entry (if exists), and send the page
  27     from MoinMoin import caching
  28     caching.CacheEntry(request, arena, key, scope='item').remove()
  29     caching.CacheEntry(request, arena, "pagelinks", scope='item').remove()
  30     #[IanRiley 2014-07-04] delete pdf created by PDF.py action
  31     caching.CacheEntry(request, arena, "text_pdf.pdf", scope='item').remove()
  32     #[IanRiley 2014-10-17] delete pdf created by PDF.py action
  33     caching.CacheEntry(request, arena, "slides_pdf.pdf", scope='item').remove()    
  34     #[IanRiley 2017-08-31] show with print option
  35     request.page.send_page(print_mode=print_mode)

You are not allowed to attach a file to this page.