changeset 1784:2668d470091f

wikiutil.getSysPage renamed to getLocalizedPage
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 18 Feb 2007 23:50:31 +0100
parents 4cfb61592fe4
children e54f99c9beba
files MoinMoin/Page.py MoinMoin/PageEditor.py MoinMoin/PageGraphicalEditor.py MoinMoin/action/fckdialog.py MoinMoin/action/userprefs.py MoinMoin/request/__init__.py MoinMoin/script/export/dump.py MoinMoin/theme/__init__.py MoinMoin/user.py MoinMoin/userform.py MoinMoin/wikiutil.py
diffstat 11 files changed, 24 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Page.py	Sun Feb 18 23:27:09 2007 +0100
+++ b/MoinMoin/Page.py	Sun Feb 18 23:50:31 2007 +0100
@@ -1327,9 +1327,9 @@
         @param request: the request object
         """
         if request.user.valid and request.user.name == self.page_name:
-            missingpage = wikiutil.getSysPage(request, 'MissingHomePage')
+            missingpage = wikiutil.getLocalizedPage(request, 'MissingHomePage')
         else:
-            missingpage = wikiutil.getSysPage(request, 'MissingPage')
+            missingpage = wikiutil.getLocalizedPage(request, 'MissingPage')
         missingpagefn = missingpage._text_filename()
         missingpage.page_name = self.page_name
         missingpage._text_filename_force = missingpagefn
--- a/MoinMoin/PageEditor.py	Sun Feb 18 23:27:09 2007 +0100
+++ b/MoinMoin/PageEditor.py	Sun Feb 18 23:50:31 2007 +0100
@@ -357,7 +357,7 @@
 If you don't want that, hit '''%(cancel_button_text)s''' to cancel your changes.""") % {
                 'save_button_text': save_button_text,
                 'cancel_button_text': cancel_button_text,
-                     'license_link': wikiutil.getSysPage(request, self.cfg.page_license_page).link_to(request),
+                     'license_link': wikiutil.getLocalizedPage(request, self.cfg.page_license_page).link_to(request),
             }, '</em></p>')
 
 
--- a/MoinMoin/PageGraphicalEditor.py	Sun Feb 18 23:27:09 2007 +0100
+++ b/MoinMoin/PageGraphicalEditor.py	Sun Feb 18 23:50:31 2007 +0100
@@ -260,7 +260,7 @@
 If you don't want that, hit '''%(cancel_button_text)s''' to cancel your changes.""") % {
                 'save_button_text': save_button_text,
                 'cancel_button_text': cancel_button_text,
-                'license_link': wikiutil.getSysPage(request, self.cfg.page_license_page).link_to(request),
+                'license_link': wikiutil.getLocalizedPage(request, self.cfg.page_license_page).link_to(request),
             }, '</em></p>')
 
         request.write('''
--- a/MoinMoin/action/fckdialog.py	Sun Feb 18 23:27:09 2007 +0100
+++ b/MoinMoin/action/fckdialog.py	Sun Feb 18 23:50:31 2007 +0100
@@ -145,7 +145,7 @@
 
 def get_macro_help(request):
     """ Read help texts from SystemPage('HelpOnMacros')"""
-    helppage = wikiutil.getSysPage(request, "HelpOnMacros")
+    helppage = wikiutil.getLocalizedPage(request, "HelpOnMacros")
     content = helppage.get_raw_body()
     macro_re = re.compile(
         r"\|\|(<.*?>)?\{\{\{\[\[" +
--- a/MoinMoin/action/userprefs.py	Sun Feb 18 23:27:09 2007 +0100
+++ b/MoinMoin/action/userprefs.py	Sun Feb 18 23:50:31 2007 +0100
@@ -18,6 +18,6 @@
 from MoinMoin import wikiutil
 
 def execute(pagename, request):
-    page = wikiutil.getSysPage(request, 'UserPreferences')
+    page = wikiutil.getLocalizedPage(request, 'UserPreferences')
     page.send_page()
 
--- a/MoinMoin/request/__init__.py	Sun Feb 18 23:27:09 2007 +0100
+++ b/MoinMoin/request/__init__.py	Sun Feb 18 23:50:31 2007 +0100
@@ -1099,7 +1099,7 @@
 Name may contain any Unicode alpha numeric character, with optional one
 space between words. Group page name is not allowed.""") % self.user.name
                 self.user = self.get_user_default_unknown(name=self.user.name, logout=True)
-                page = wikiutil.getSysPage(self, 'UserPreferences')
+                page = wikiutil.getLocalizedPage(self, 'UserPreferences')
                 page.send_page(self, msg=msg)
 
             # 2. Or jump to page where user left off
--- a/MoinMoin/script/export/dump.py	Sun Feb 18 23:27:09 2007 +0100
+++ b/MoinMoin/script/export/dump.py	Sun Feb 18 23:50:31 2007 +0100
@@ -132,9 +132,9 @@
         errlog = open(errfile, 'w')
         errcnt = 0
 
-        page_front_page = wikiutil.getSysPage(request, request.cfg.page_front_page).page_name
-        page_title_index = wikiutil.getSysPage(request, 'TitleIndex').page_name
-        page_word_index = wikiutil.getSysPage(request, 'WordIndex').page_name
+        page_front_page = wikiutil.getLocalizedPage(request, request.cfg.page_front_page).page_name
+        page_title_index = wikiutil.getLocalizedPage(request, 'TitleIndex').page_name
+        page_word_index = wikiutil.getLocalizedPage(request, 'WordIndex').page_name
 
         navibar_html = ''
         for p in [page_front_page, page_title_index, page_word_index]:
--- a/MoinMoin/theme/__init__.py	Sun Feb 18 23:27:09 2007 +0100
+++ b/MoinMoin/theme/__init__.py	Sun Feb 18 23:50:31 2007 +0100
@@ -327,7 +327,7 @@
         else:
             # Use localized pages for the current user
             if localize:
-                page = wikiutil.getSysPage(request, text)
+                page = wikiutil.getLocalizedPage(request, text)
             else:
                 page = Page(request, text)
             pagename = page.page_name
@@ -1442,13 +1442,13 @@
 
         # get name of system pages
         page_front_page = wikiutil.getFrontPage(request).page_name
-        page_help_contents = wikiutil.getSysPage(request, 'HelpContents').page_name
-        page_title_index = wikiutil.getSysPage(request, 'TitleIndex').page_name
-        page_site_navigation = wikiutil.getSysPage(request, 'SiteNavigation').page_name
-        page_word_index = wikiutil.getSysPage(request, 'WordIndex').page_name
-        page_user_prefs = wikiutil.getSysPage(request, 'UserPreferences').page_name
-        page_help_formatting = wikiutil.getSysPage(request, 'HelpOnFormatting').page_name
-        page_find_page = wikiutil.getSysPage(request, 'FindPage').page_name
+        page_help_contents = wikiutil.getLocalizedPage(request, 'HelpContents').page_name
+        page_title_index = wikiutil.getLocalizedPage(request, 'TitleIndex').page_name
+        page_site_navigation = wikiutil.getLocalizedPage(request, 'SiteNavigation').page_name
+        page_word_index = wikiutil.getLocalizedPage(request, 'WordIndex').page_name
+        page_user_prefs = wikiutil.getLocalizedPage(request, 'UserPreferences').page_name
+        page_help_formatting = wikiutil.getLocalizedPage(request, 'HelpOnFormatting').page_name
+        page_find_page = wikiutil.getLocalizedPage(request, 'FindPage').page_name
         home_page = wikiutil.getInterwikiHomePage(request) # XXX sorry theme API change!!! Either None or tuple (wikiname,pagename) now.
         page_parent_page = getattr(page.getParentPage(), 'page_name', None)
 
--- a/MoinMoin/user.py	Sun Feb 18 23:27:09 2007 +0100
+++ b/MoinMoin/user.py	Sun Feb 18 23:50:31 2007 +0100
@@ -930,7 +930,7 @@
 
     def mailAccountData(self, cleartext_passwd=None):
         from MoinMoin.mail import sendmail
-        from MoinMoin.wikiutil import getSysPage
+        from MoinMoin.wikiutil import getLocalizedPage
         _ = self._request.getText
 
         if not self.enc_password: # generate pw if there is none yet
@@ -954,7 +954,7 @@
 
 Login URL: %s/%s?action=login
 """, formatted=False) % (
-                        self.name, self.enc_password, self._request.getBaseURL(), getSysPage(self._request, 'UserPreferences').page_name)
+                        self.name, self.enc_password, self._request.getBaseURL(), getLocalizedPage(self._request, 'UserPreferences').page_name)
 
         text = _("""\
 Somebody has requested to submit your account data to this email address.
--- a/MoinMoin/userform.py	Sun Feb 18 23:27:09 2007 +0100
+++ b/MoinMoin/userform.py	Sun Feb 18 23:50:31 2007 +0100
@@ -637,8 +637,8 @@
         sn = request.getScriptname()
         pi = request.getPathinfo()
         action = u"%s%s" % (sn, pi)
-        userprefslink = wikiutil.getSysPage(request, "UserPreferences").link_to(request, rel='nofollow')
-        sendmypasswordlink = wikiutil.getSysPage(request, "SendMyPassword").link_to(request, rel='nofollow')
+        userprefslink = wikiutil.getLocalizedPage(request, "UserPreferences").link_to(request, rel='nofollow')
+        sendmypasswordlink = wikiutil.getLocalizedPage(request, "SendMyPassword").link_to(request, rel='nofollow')
         hint = _("To create an account, see the %(userprefslink)s page. To recover a lost password, go to %(sendmypasswordlink)s.") % {
                  'userprefslink': userprefslink,
                  'sendmypasswordlink': sendmypasswordlink}
--- a/MoinMoin/wikiutil.py	Sun Feb 18 23:27:09 2007 +0100
+++ b/MoinMoin/wikiutil.py	Sun Feb 18 23:50:31 2007 +0100
@@ -711,9 +711,7 @@
     return filter(func, pagelist)
 
 
-# TODO: we may rename this to getLocalizedPage because it returns page
-# that have translations.
-def getSysPage(request, pagename):
+def getLocalizedPage(request, pagename): # was: getSysPage
     """ Get a system page according to user settings and available translations.
     
     We include some special treatment for the case that <pagename> is the
@@ -759,7 +757,7 @@
     @rtype: Page object
     @return localized page_front_page, if there is a translation
     """
-    return getSysPage(request, request.cfg.page_front_page)
+    return getLocalizedPage(request, request.cfg.page_front_page)
 
 
 def getHomePage(request, username=None):