changeset 4737:ebe54f59e87c

system/help page packages: build all pagesets, use LanguageSetup as front page (unifies old SystemPagesSetup with the setup specific part of HelpOnLanguages)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 01 Jun 2009 17:55:26 +0200
parents d887cc013e76
children 4cf58f58fff3
files MoinMoin/config/multiconfig.py MoinMoin/i18n/strings.py MoinMoin/script/maint/mkpagepacks.py
diffstat 3 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/config/multiconfig.py	Mon Jun 01 14:08:52 2009 +0200
+++ b/MoinMoin/config/multiconfig.py	Mon Jun 01 17:55:26 2009 +0200
@@ -932,8 +932,8 @@
   )),
   # ==========================================================================
   'pages': ('Special page names', None, (
-    ('page_front_page', u'HelpOnLanguages',
-     "Name of the front page. We don't expect you to keep the default. Just read HelpOnLanguages in case you're wondering... [Unicode]"),
+    ('page_front_page', u'LanguageSetup',
+     "Name of the front page. We don't expect you to keep the default. Just read LanguageSetup in case you're wondering... [Unicode]"),
 
     # the following regexes should match the complete name when used in free text
     # the group 'all' shall match all, while the group 'key' shall match the key only
--- a/MoinMoin/i18n/strings.py	Mon Jun 01 14:08:52 2009 +0200
+++ b/MoinMoin/i18n/strings.py	Mon Jun 01 17:55:26 2009 +0200
@@ -20,7 +20,7 @@
 
 # Some basic pages used for every language, but we only need them once in English (don't translate!):
 not_translated_system_pages = [
-    'SystemPagesSetup',
+    'LanguageSetup',
     'InterWikiMap',
     'BadContent',
     'LocalBadContent',
--- a/MoinMoin/script/maint/mkpagepacks.py	Mon Jun 01 14:08:52 2009 +0200
+++ b/MoinMoin/script/maint/mkpagepacks.py	Mon Jun 01 17:55:26 2009 +0200
@@ -48,8 +48,11 @@
         """ Calculates which pages should go into which package. """
         request = self.request
 
+        all_pages = set(request.rootpage.getPageList())
+        packaged_pages = set()
+
         languages = i18n.wikiLanguages()
-        pageset_names = ['all_pages', ] # TODO: refine later
+        pageset_names = i18n.strings.pagesets
         pageSets = {}
         for lang in languages:
             def trans(text, request=request, lang=lang, **kw):
@@ -71,7 +74,10 @@
                 if pageset:
                     print key, len(pageset)
                     pageSets[key] = pageset
+                    packaged_pages |= pageset
 
+        not_packaged_pages = all_pages - packaged_pages
+        pageSets['00_needs_fixing'] = not_packaged_pages
         return pageSets
 
     def packagePages(self, pagelist, filename, function):
@@ -143,7 +149,7 @@
         [self.packagePages(list(pages), generate_filename(name), "ReplaceUnderlay") for name, pages in pageSets.items()]
 
         print "Removing pagedirs of packaged pages ..."
-        dontkill = set(['SystemPagesSetup'])
+        dontkill = set(['LanguageSetup'])
         [self.removePages(list(pages - dontkill)) for name, pages in pageSets.items()]
 
         print "Finished."