annotate MoinMoin/action/refresh.py @ 4109:e88baf535b48

fix backup action configuration (broke on windows due to backslashes in e.g. cache_dir), try 2. cfg.backup_exclude is now just a function of filename, telling whether the file should be excluded. By default, no file is excluded.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 19 Sep 2008 21:41:40 +0200
parents bb2e053067fb
children 40acd13fb3d6
rev   line source
1125
0f5d10f9b31b re-add and fix refresh action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
1 # -*- coding: iso-8859-1 -*-
0f5d10f9b31b re-add and fix refresh action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
2 """
0f5d10f9b31b re-add and fix refresh action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
3 MoinMoin - refresh cache of a page
0f5d10f9b31b re-add and fix refresh action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
4
1918
bb2e053067fb fixing copyright headers: remove umlauts (encoding troubles), make epydoc compatible, reformat
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1777
diff changeset
5 @copyright: 2000-2004 Juergen Hermann <jh@web.de>,
bb2e053067fb fixing copyright headers: remove umlauts (encoding troubles), make epydoc compatible, reformat
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1777
diff changeset
6 2006 MoinMoin:ThomasWaldmann
1125
0f5d10f9b31b re-add and fix refresh action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
7 @license: GNU GPL, see COPYING for details.
0f5d10f9b31b re-add and fix refresh action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
8 """
0f5d10f9b31b re-add and fix refresh action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
9 from MoinMoin.Page import Page
0f5d10f9b31b re-add and fix refresh action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
10
0f5d10f9b31b re-add and fix refresh action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
11 def execute(pagename, request):
0f5d10f9b31b re-add and fix refresh action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
12 """ Handle refresh action """
0f5d10f9b31b re-add and fix refresh action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
13 # Without arguments, refresh action will refresh the page text_html cache.
0f5d10f9b31b re-add and fix refresh action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
14 arena = request.form.get('arena', ['Page.py'])[0]
0f5d10f9b31b re-add and fix refresh action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
15 if arena == 'Page.py':
0f5d10f9b31b re-add and fix refresh action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
16 arena = Page(request, pagename)
0f5d10f9b31b re-add and fix refresh action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
17 key = request.form.get('key', ['text_html'])[0]
0f5d10f9b31b re-add and fix refresh action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
18
0f5d10f9b31b re-add and fix refresh action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
19 # Remove cache entry (if exists), and send the page
0f5d10f9b31b re-add and fix refresh action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
20 from MoinMoin import caching
0f5d10f9b31b re-add and fix refresh action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
21 caching.CacheEntry(request, arena, key, scope='item').remove()
0f5d10f9b31b re-add and fix refresh action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
22 caching.CacheEntry(request, arena, "pagelinks", scope='item').remove()
1777
ed44b93599b5 remove unneeded request param from page.send_page()
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1125
diff changeset
23 request.page.send_page()
1125
0f5d10f9b31b re-add and fix refresh action
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
24