changeset 3143:16ae95df840a

i18n.getText: fixed some callers that had still 'formatted=' kw args
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 27 Feb 2008 15:52:30 +0100
parents fe93fb0732a2
children 7aba52041f56
files MoinMoin/PageGraphicalEditor.py MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py MoinMoin/events/emailnotify.py MoinMoin/events/jabbernotify.py MoinMoin/events/notification.py MoinMoin/i18n/__init__.py MoinMoin/macro/GetText2.py MoinMoin/macro/NewPage.py MoinMoin/parser/_tests/test_text_creole.py MoinMoin/parser/_tests/test_text_moin_wiki.py MoinMoin/wikiutil.py
diffstat 11 files changed, 18 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/PageGraphicalEditor.py	Wed Feb 27 15:41:41 2008 +0100
+++ b/MoinMoin/PageGraphicalEditor.py	Wed Feb 27 15:52:30 2008 +0100
@@ -370,7 +370,7 @@
         cat_pages = request.rootpage.getPageList(filter=filterfn)
         cat_pages.sort()
         cat_pages = [wikiutil.pagelinkmarkup(p) for p in cat_pages]
-        cat_pages.insert(0, ('', _('<No addition>', formatted=False)))
+        cat_pages.insert(0, ('', _('<No addition>')))
         request.write("<p>")
         request.write(_('Add to: %(category)s') % {
             'category': unicode(web.makeSelection('category', cat_pages)),
--- a/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py	Wed Feb 27 15:41:41 2008 +0100
+++ b/MoinMoin/converter/_tests/test_text_html_text_moin_wiki.py	Wed Feb 27 15:52:30 2008 +0100
@@ -64,7 +64,7 @@
         self._page_headings = {}
         self.result = []
 
-    def getText(self, text, formatted=True):
+    def getText(self, text, wiki=False, percent=False):
         return text
 
     def write(self, text):
--- a/MoinMoin/events/emailnotify.py	Wed Feb 27 15:41:41 2008 +0100
+++ b/MoinMoin/events/emailnotify.py	Wed Feb 27 15:52:30 2008 +0100
@@ -33,7 +33,7 @@
 
     """
     change = notification.page_change_message("page_changed", request, page, email_lang, comment=comment, revisions=revisions)
-    _ = lambda s, formatted=True, r=request, l=email_lang: r.getText(s, formatted=formatted, lang=l)
+    _ = lambda s, wiki=False, r=request, l=email_lang: r.getText(s, wiki=wiki, lang=l)
 
     subject = _('[%(sitename)s] %(trivial)sUpdate of "%(pagename)s" by %(username)s') % {
             'trivial': (trivial and _("Trivial ")) or "",
@@ -135,7 +135,7 @@
 
     for lang in subscribers:
         emails = []
-        _ = lambda text: request.getText(text, lang=lang, formatted=False)
+        _ = lambda text: request.getText(text, lang=lang)
 
         links = _("Attachment link: %(attach)s\n" \
                   "Page link: %(page)s\n") % {'attach': attachlink, 'page': pagelink}
--- a/MoinMoin/events/jabbernotify.py	Wed Feb 27 15:41:41 2008 +0100
+++ b/MoinMoin/events/jabbernotify.py	Wed Feb 27 15:52:30 2008 +0100
@@ -82,7 +82,7 @@
     pagelink = request.getQualifiedURL(page.url(request, {}, relative=False))
 
     for lang in subscribers.keys():
-        _ = lambda text: request.getText(text, lang=lang, formatted=False)
+        _ = lambda text: request.getText(text, lang=lang)
         data = notification.attachment_added(request, _, event.pagename, event.filename, event.size)
         links = [{'url': attachlink, 'description': _("Attachment link")},
                   {'url': pagelink, 'description': _("Page link")}]
--- a/MoinMoin/events/notification.py	Wed Feb 27 15:41:41 2008 +0100
+++ b/MoinMoin/events/notification.py	Wed Feb 27 15:52:30 2008 +0100
@@ -71,7 +71,7 @@
     from MoinMoin.action.AttachFile import getAttachUrl
 
     _ = request.getText
-    page._ = lambda s, formatted=True, r=request, l=lang: r.getText(s, formatted=formatted, lang=l)
+    page._ = lambda s, wiki=False, r=request, l=lang: r.getText(s, wiki=wiki, lang=l)
     querystr = {}
     changes = {'page_name': page.page_name, 'revision': str(page.getRevList()[0])}
 
--- a/MoinMoin/i18n/__init__.py	Wed Feb 27 15:41:41 2008 +0100
+++ b/MoinMoin/i18n/__init__.py	Wed Feb 27 15:52:30 2008 +0100
@@ -246,8 +246,8 @@
                       become %% for that usage. This will only escape generated % chars,
                       e.g. in wiki links to non-ascii pagenames (%XX%XX%XX).
                       False, if we don't use it as a left-side of % operator.
-                      Only specify this option for formatted==True, it doesn't do
-                      anything for formatted==False.
+                      Only specify this option for wiki==True, it doesn't do
+                      anything for wiki==False.
     """
     formatted = kw.get('wiki', False) # 1.6 and early 1.7 (until 2/2008) used 'formatted' with True as default!
     percent = kw.get('percent', False)
@@ -294,7 +294,7 @@
             logging.debug("requested string not in %r translation: %r" % (lang, original))
             if lang != 'en':
                 logging.debug("falling back from %r to english" % lang)
-                translated = getText(original, request, 'en', formatted=formatted, percent=percent)
+                translated = getText(original, request, 'en', wiki=formatted, percent=percent)
             elif formatted: # and lang == 'en'
                 logging.debug("formatting for %r on the fly: %r" % (lang, original))
                 translated = translations[lang].formatMarkup(request, original, percent)
--- a/MoinMoin/macro/GetText2.py	Wed Feb 27 15:41:41 2008 +0100
+++ b/MoinMoin/macro/GetText2.py	Wed Feb 27 15:52:30 2008 +0100
@@ -22,7 +22,7 @@
     sep = args[0]
     args = unpackLine(args[1:], sep)
     if args:
-        translation = macro.request.getText(args[0], formatted=False)
+        translation = macro.request.getText(args[0])
     else:
         translation = u""
     message = translation % tuple(args[1:])
--- a/MoinMoin/macro/NewPage.py	Wed Feb 27 15:41:41 2008 +0100
+++ b/MoinMoin/macro/NewPage.py	Wed Feb 27 15:52:30 2008 +0100
@@ -85,7 +85,7 @@
         if label:
             # Try to get a translation, this will probably not work in
             # most cases, but better than nothing.
-            label = self.request.getText(label, formatted=False)
+            label = self.request.getText(label)
         else:
             label = _("Create New Page")
 
--- a/MoinMoin/parser/_tests/test_text_creole.py	Wed Feb 27 15:41:41 2008 +0100
+++ b/MoinMoin/parser/_tests/test_text_creole.py	Wed Feb 27 15:52:30 2008 +0100
@@ -237,17 +237,17 @@
 #
 #    def testEscapeInGetTextFormatted(self):
 #        """ parser.wiki: escape html markup in getText formatted call """
-#        test = self.request.getText('<escape-me>', formatted=1)
+#        test = self.request.getText('<escape-me>', wiki=True)
 #        self._test(test)
 #
 #    def testEscapeInGetTextFormatedLink(self):
 #        """ parser.wiki: escape html markup in getText formatted call with link """
-#        test = self.request.getText('[[<escape-me>]]', formatted=1)
+#        test = self.request.getText('[[<escape-me>]]', wiki=True)
 #        self._test(test)
 
     def testEscapeInGetTextUnFormatted(self):
         """ parser.wiki: escape html markup in getText non formatted call """
-        test = self.request.getText('<escape-me>', formatted=0)
+        test = self.request.getText('<escape-me>', wiki=False)
         self._test(test)
 
     def _test(self, test):
--- a/MoinMoin/parser/_tests/test_text_moin_wiki.py	Wed Feb 27 15:41:41 2008 +0100
+++ b/MoinMoin/parser/_tests/test_text_moin_wiki.py	Wed Feb 27 15:52:30 2008 +0100
@@ -298,17 +298,17 @@
 
     def testEscapeInGetTextFormatted(self):
         """ parser.wiki: escape html markup in getText formatted call """
-        test = self.request.getText('<escape-me>', formatted=1)
+        test = self.request.getText('<escape-me>', wiki=True)
         self._test(test)
 
     def testEscapeInGetTextFormatedLink(self):
         """ parser.wiki: escape html markup in getText formatted call with link """
-        test = self.request.getText('[[<escape-me>]]', formatted=1)
+        test = self.request.getText('[[<escape-me>]]', wiki=True)
         self._test(test)
 
     def testEscapeInGetTextUnFormatted(self):
         """ parser.wiki: escape html markup in getText non formatted call """
-        test = self.request.getText('<escape-me>', formatted=0)
+        test = self.request.getText('<escape-me>', wiki=False)
         self._test(test)
 
     def _test(self, test):
--- a/MoinMoin/wikiutil.py	Wed Feb 27 15:41:41 2008 +0100
+++ b/MoinMoin/wikiutil.py	Wed Feb 27 15:52:30 2008 +0100
@@ -751,7 +751,7 @@
              if it exists
     """
     from MoinMoin.Page import Page
-    i18n_name = request.getText(pagename, formatted=False)
+    i18n_name = request.getText(pagename)
     pageobj = None
     if i18n_name != pagename:
         if request.page and i18n_name == request.page.page_name: