Back to index

moin  1.9.0~rc2
makecache.py
Go to the documentation of this file.
00001 # -*- coding: iso-8859-1 -*-
00002 """
00003 MoinMoin - makecache script
00004 
00005 @copyright: 2008 MoinMoin:ReimarBauer
00006 @license: GNU GPL, see COPYING for details.
00007 """
00008 
00009 from MoinMoin import caching
00010 from MoinMoin.Page import Page
00011 from MoinMoin.script import MoinScript
00012 from MoinMoin.stats import hitcounts
00013 
00014 class PluginScript(MoinScript):
00015     """\
00016 Purpose:
00017 ========
00018 This script allows you to create cache files in data/pages/PageName/cache/
00019 and /data/cache directories
00020 
00021 You will usually do this after changing MoinMoin code and calling "maint cleancache", by either upgrading
00022 version, installing or removing macros.
00023 
00024 text_html is the name of the cache file used for compiled pages formatted
00025 by the wiki text to html formatter.
00026 
00027 Detailed Instructions:
00028 ======================
00029 General syntax: moin [options] maint makecache
00030 
00031 [options] usually should be:
00032     --config-dir=/path/to/my/cfg/ --wiki-url=wiki.example.org/
00033 """
00034 
00035     def __init__(self, argv, def_values):
00036         MoinScript.__init__(self, argv, def_values)
00037 
00038     def mainloop(self):
00039         self.init_request()
00040         request = self.request
00041 
00042         # make cache related to pagelinks entries of a page
00043         pages = request.rootpage.getPageList(user='', exists=1)
00044         for pagename in pages:
00045             page = Page(request, pagename)
00046             request.page = page
00047             p = page.getPageLinks(request)
00048