changeset 1777:ed44b93599b5

remove unneeded request param from page.send_page()
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 18 Feb 2007 21:39:36 +0100
parents fc75423e26a8
children 465b0086c410
files MoinMoin/Page.py MoinMoin/PageEditor.py MoinMoin/PageGraphicalEditor.py MoinMoin/_tests/test_formatter.py MoinMoin/action/AttachFile.py MoinMoin/action/Despam.py MoinMoin/action/LikePages.py MoinMoin/action/MyPages.py MoinMoin/action/PackagePages.py MoinMoin/action/SpellCheck.py MoinMoin/action/SubscribeUser.py MoinMoin/action/SyncPages.py MoinMoin/action/backup.py MoinMoin/action/bookmark.py MoinMoin/action/chart.py MoinMoin/action/diff.py MoinMoin/action/edit.py MoinMoin/action/fckdialog.py MoinMoin/action/fullsearch.py MoinMoin/action/info.py MoinMoin/action/login.py MoinMoin/action/logout.py MoinMoin/action/newpage.py MoinMoin/action/quicklink.py MoinMoin/action/refresh.py MoinMoin/action/revert.py MoinMoin/action/subscribe.py MoinMoin/action/userprefs.py MoinMoin/macro/Include.py MoinMoin/macro/RandomQuote.py MoinMoin/script/export/dump.py MoinMoin/xmlrpc/UpdateGroup.py MoinMoin/xmlrpc/__init__.py
diffstat 33 files changed, 57 insertions(+), 60 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Page.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/Page.py	Sun Feb 18 21:39:36 2007 +0100
@@ -885,14 +885,13 @@
         request.write(text)
 
 
-    def send_page(self, request, msg=None, **keywords):
+    def send_page(self, msg=None, **keywords):
         """ Output the formatted page.
 
         TODO: remove request argument - page is created with a request
         instance. Enable removing request argument recursively from all
         functions called from here.
 
-        @param request: the request object
         @param msg: if given, display message in header area
         @keyword content_only: if 1, omit http headers, page header and footer
         @keyword content_id: set the id of the enclosing div
@@ -900,6 +899,7 @@
         @keyword send_missing_page: if 1, assume that page to be sent is MissingPage
         @keyword omit_footnotes: if True, do not send footnotes (used by include macro)
         """
+        request = self.request
         from MoinMoin import i18n
         request.clock.start('send_page')
         _ = request.getText
@@ -1339,7 +1339,7 @@
         missingpagefn = missingpage._text_filename()
         missingpage.page_name = self.page_name
         missingpage._text_filename_force = missingpagefn
-        missingpage.send_page(request, content_only=1, send_missing_page=1)
+        missingpage.send_page(content_only=1, send_missing_page=1)
 
 
     def getRevList(self):
@@ -1481,7 +1481,7 @@
                 from MoinMoin.formatter.pagelinks import Formatter
                 formatter = Formatter(request, store_pagelinks=1)
                 page = Page(request, pagename, formatter=formatter)
-                page.send_page(request, content_only=1)
+                page.send_page(content_only=1)
             except:
                 import traceback
                 traceback.print_exc(200)
--- a/MoinMoin/PageEditor.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/PageEditor.py	Sun Feb 18 21:39:36 2007 +0100
@@ -184,7 +184,7 @@
 
         # Did one of the prechecks fail?
         if msg:
-            self.send_page(request, msg=msg)
+            self.send_page(msg=msg)
             return
 
         # check if we want to load a draft
@@ -465,8 +465,7 @@
                 content_id = 'previewbelow'
             else:
                 content_id = 'preview'
-            self.send_page(request, content_id=content_id, content_only=1,
-                           hilite_re=badwords_re)
+            self.send_page(content_id=content_id, content_only=1, hilite_re=badwords_re)
 
         request.write(request.formatter.endContent())
         request.theme.send_footer(self.page_name)
@@ -487,7 +486,7 @@
 
         backto = request.form.get('backto', [None])[0]
         page = backto and Page(request, backto) or self
-        page.send_page(request, msg=_('Edit was cancelled.'))
+        page.send_page(msg=_('Edit was cancelled.'))
 
     def renamePage(self, newpagename, comment=None):
         """
--- a/MoinMoin/PageGraphicalEditor.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/PageGraphicalEditor.py	Sun Feb 18 21:39:36 2007 +0100
@@ -23,7 +23,7 @@
 def execute(pagename, request):
     if not request.user.may.write(pagename):
         _ = request.getText
-        Page(request, pagename).send_page(request, msg=_('You are not allowed to edit this page.'))
+        Page(request, pagename).send_page(msg=_('You are not allowed to edit this page.'))
         return
 
     PageGraphicalEditor(request, pagename).sendEditor()
@@ -85,7 +85,7 @@
 
         # Did one of the prechecks fail?
         if msg:
-            self.send_page(request, msg=msg)
+            self.send_page(msg=msg)
             return
 
         # check if we want to load a draft
@@ -388,8 +388,7 @@
                 content_id = 'previewbelow'
             else:
                 content_id = 'preview'
-            self.send_page(request, content_id=content_id, content_only=1,
-                           hilite_re=badwords_re)
+            self.send_page(content_id=content_id, content_only=1, hilite_re=badwords_re)
 
         request.write(request.formatter.endContent()) # end content div
         request.theme.send_footer(self.page_name)
--- a/MoinMoin/_tests/test_formatter.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/_tests/test_formatter.py	Sun Feb 18 21:39:36 2007 +0100
@@ -40,5 +40,5 @@
         #page.formatter.setPage(page)
         #page.hilite_re = None
 
-        return self.request.redirectedOutput(page.send_page, self.request)
+        return self.request.redirectedOutput(page.send_page)
 
--- a/MoinMoin/action/AttachFile.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/AttachFile.py	Sun Feb 18 21:39:36 2007 +0100
@@ -380,7 +380,7 @@
     return names #Returns dict of {origname: safename}
 
 def error_msg(pagename, request, msg):
-    Page(request, pagename).send_page(request, msg=msg)
+    Page(request, pagename).send_page(msg=msg)
 
 
 #############################################################################
@@ -799,7 +799,7 @@
 </table>
 </form>''' % d
     thispage = Page(request, pagename)
-    return thispage.send_page(request, msg=formhtml)
+    return thispage.send_page(msg=formhtml)
 
 def get_file(pagename, request):
     import shutil
--- a/MoinMoin/action/Despam.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/Despam.py	Sun Feb 18 21:39:36 2007 +0100
@@ -166,7 +166,7 @@
     actname = __name__.split('.')[-1]
     if actname in request.cfg.actions_excluded or \
        not request.user.isSuperUser():
-        return Page.Page(request, pagename).send_page(request,
+        return Page.Page(request, pagename).send_page(
             msg=_('You are not allowed to use this action.'))
 
     editor = request.form.get('editor', [None])[0]
--- a/MoinMoin/action/LikePages.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/LikePages.py	Sun Feb 18 21:39:36 2007 +0100
@@ -24,18 +24,18 @@
 
     # Error?
     if isinstance(matches, (str, unicode)):
-        Page(request, pagename).send_page(request, msg=matches)
+        Page(request, pagename).send_page(msg=matches)
         return
 
     # No matches
     if not matches:
-        Page(request, pagename).send_page(request,
+        Page(request, pagename).send_page(
              msg=_('No pages like "%s"!') % (pagename,))
         return
 
     # One match - display it
     if len(matches) == 1:
-        Page(request, matches.keys()[0]).send_page(request,
+        Page(request, matches.keys()[0]).send_page(
              msg=_('Exactly one page like "%s" found, redirecting to page.') % (
             pagename,))
         return
--- a/MoinMoin/action/MyPages.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/MyPages.py	Sun Feb 18 21:39:36 2007 +0100
@@ -19,7 +19,7 @@
         username = ''
 
     if not username:
-        return thispage.send_page(request, msg=_('Please log in first.'))
+        return thispage.send_page(msg=_('Please log in first.'))
 
     userhomewiki = request.cfg.user_homewiki
     if userhomewiki != 'Self' and userhomewiki != request.cfg.interwikiname:
@@ -31,7 +31,7 @@
 
     homepage = Page(request, username)
     if not homepage.exists():
-        return homepage.send_page(request,
+        return homepage.send_page(
             msg=_('Please first create a homepage before creating additional pages.'))
 
     pagecontent = _("""\
--- a/MoinMoin/action/PackagePages.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/PackagePages.py	Sun Feb 18 21:39:36 2007 +0100
@@ -47,7 +47,7 @@
 
         if form.has_key('cancel'):
             # User canceled
-            return self.page.send_page(self.request)
+            return self.page.send_page()
 
         try:
             if not self.allowed():
@@ -57,7 +57,7 @@
 
             self.package()
         except ActionError, e:
-            return self.page.send_page(self.request, msg=e.args[0])
+            return self.page.send_page(msg=e.args[0])
 
     def package(self):
         """ Packages pages. """
--- a/MoinMoin/action/SpellCheck.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/SpellCheck.py	Sun Feb 18 21:39:36 2007 +0100
@@ -219,7 +219,7 @@
         msg = _("You can't check spelling on a page you can't read.")
 
     if badwords:
-        page.send_page(request, msg=msg, hilite_re=badwords_re)
+        page.send_page(msg=msg, hilite_re=badwords_re)
     else:
-        page.send_page(request, msg=msg)
+        page.send_page(msg=msg)
 
--- a/MoinMoin/action/SubscribeUser.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/SubscribeUser.py	Sun Feb 18 21:39:36 2007 +0100
@@ -87,7 +87,7 @@
     _ = request.getText
     if not request.user.may.admin(pagename):
         thispage = Page(request, pagename)
-        return thispage.send_page(request, msg=_("You are not allowed to perform this action."))
+        return thispage.send_page(msg=_("You are not allowed to perform this action."))
     elif not request.form.has_key('users'):
         show_form(pagename, request)
     else:
--- a/MoinMoin/action/SyncPages.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/SyncPages.py	Sun Feb 18 21:39:36 2007 +0100
@@ -167,7 +167,7 @@
 </div>
 </form>
 """ % d
-        self.page.send_page(self.request, msg=html_form)
+        self.page.send_page(msg=html_form)
 
     def render(self):
         """ Render action
@@ -221,7 +221,7 @@
                 self.page.saveText(self.page.get_raw_body() + "\n\n" + self.generate_log_table(), 0)
                 # XXX release readlock on self.page
 
-        return self.page.send_page(self.request, msg=msg)
+        return self.page.send_page(msg=msg)
 
     def sync(self, params, local, remote):
         """ This method does the synchronisation work.
--- a/MoinMoin/action/backup.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/backup.py	Sun Feb 18 21:39:36 2007 +0100
@@ -115,7 +115,7 @@
 
 def sendMsg(request, pagename, msg):
     from MoinMoin import Page
-    return Page.Page(request, pagename).send_page(request, msg=msg)
+    return Page.Page(request, pagename).send_page(msg=msg)
 
 def backupAllowed(request):
     """ Return True if backup is allowed """
--- a/MoinMoin/action/bookmark.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/bookmark.py	Sun Feb 18 21:39:36 2007 +0100
@@ -29,5 +29,5 @@
         request.user.delBookmark()
     else:
         request.user.setBookmark(tm)
-    request.page.send_page(request)
+    request.page.send_page()
 
--- a/MoinMoin/action/chart.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/chart.py	Sun Feb 18 21:39:36 2007 +0100
@@ -13,22 +13,22 @@
     _ = request.getText
     if not request.user.may.read(pagename):
         msg = _("You are not allowed to view this page.")
-        return request.page.send_page(request, msg=msg)
+        return request.page.send_page(msg=msg)
 
     if not request.cfg.chart_options:
         msg = _("Charts are not available!")
-        return request.page.send_page(request, msg=msg)
+        return request.page.send_page(msg=msg)
 
     chart_type = request.form.get('type', [''])[0].strip()
     if not chart_type:
         msg = _('You need to provide a chart type!')
-        return request.page.send_page(request, msg=msg)
+        return request.page.send_page(msg=msg)
 
     try:
         func = pysupport.importName("MoinMoin.stats.%s" % chart_type, 'draw')
     except (ImportError, AttributeError), err:
         msg = _('Bad chart type "%s"!') % chart_type
-        return request.page.send_page(request, msg=msg)
+        return request.page.send_page(msg=msg)
 
     func(pagename, request)
 
--- a/MoinMoin/action/diff.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/diff.py	Sun Feb 18 21:39:36 2007 +0100
@@ -17,7 +17,7 @@
         or rev1 and rev2 parameters
     """
     if not request.user.may.read(pagename):
-        Page(request, pagename).send_page(request)
+        Page(request, pagename).send_page()
         return
 
     try:
@@ -52,7 +52,7 @@
     currentpage = Page(request, pagename)
     revisions = currentpage.getRevList()
     if len(revisions) < 2:
-        currentpage.send_page(request, msg=_("No older revisions available!"))
+        currentpage.send_page(msg=_("No older revisions available!"))
         return
 
     if date: # this is how we get called from RecentChanges
@@ -127,7 +127,7 @@
     if request.user.show_fancy_diff:
         from MoinMoin.util import diff_html
         request.write(f.rawHTML(diff_html.diff(request, oldpage.get_raw_body(), newpage.get_raw_body())))
-        newpage.send_page(request, count_hit=0, content_only=1, content_id="content-below-diff")
+        newpage.send_page(count_hit=0, content_only=1, content_id="content-below-diff")
     else:
         from MoinMoin.util import diff_text
         lines = diff_text.diff(oldpage.getlines(), newpage.getlines())
--- a/MoinMoin/action/edit.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/edit.py	Sun Feb 18 21:39:36 2007 +0100
@@ -23,7 +23,7 @@
         return
 
     if not request.user.may.write(pagename):
-        Page(request, pagename).send_page(request,
+        Page(request, pagename).send_page(
             msg=_('You are not allowed to edit this page.'))
         return
 
@@ -82,7 +82,7 @@
         ticket = request.form.get('ticket', [''])[0]
         if not wikiutil.checkTicket(request, ticket):
             msg = _('Please use the interactive user interface to use action %(actionname)s!') % {'actionname': 'edit' }
-            pg.send_page(request, msg=msg)
+            pg.send_page(msg=msg)
             return
 
     # convert input from Graphical editor
@@ -171,5 +171,5 @@
         if backto:
             pg = Page(request, backto)
 
-        pg.send_page(request, msg=savemsg)
+        pg.send_page(msg=savemsg)
 
--- a/MoinMoin/action/fckdialog.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/fckdialog.py	Sun Feb 18 21:39:36 2007 +0100
@@ -539,5 +539,5 @@
         image_dialog(request)
     else:
         from MoinMoin.Page import Page
-        Page(request, pagename).send_page(request, msg="Dialog unknown!")
+        Page(request, pagename).send_page(msg="Dialog unknown!")
 
--- a/MoinMoin/action/fullsearch.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/fullsearch.py	Sun Feb 18 21:39:36 2007 +0100
@@ -160,7 +160,7 @@
     if len(stripped) == 0:
         err = _('Please use a more selective search term instead '
                 'of {{{"%s"}}}') % needle
-        Page(request, pagename).send_page(request, msg=err)
+        Page(request, pagename).send_page(msg=err)
         return
     needle = stripped
 
@@ -184,7 +184,7 @@
     except ValueError: # catch errors in the search query
         err = _('Your search query {{{"%s"}}} is invalid. Please refer to '
                 'HelpOnSearching for more information.') % needle
-        Page(request, pagename).send_page(request, msg=err)
+        Page(request, pagename).send_page(msg=err)
         return
 
     # directly show a single hit
@@ -213,7 +213,7 @@
                         _('full-text search with your search terms'),
                         f.url(0), '.',
                     ]) or '')
-        Page(request, pagename).send_page(request, msg=err)
+        Page(request, pagename).send_page(msg=err)
         return
 
     request.emit_http_headers()
--- a/MoinMoin/action/info.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/info.py	Sun Feb 18 21:39:36 2007 +0100
@@ -18,7 +18,7 @@
 def execute(pagename, request):
     """ show misc. infos about a page """
     if not request.user.may.read(pagename):
-        Page(request, pagename).send_page(request)
+        Page(request, pagename).send_page()
         return
 
     def general(page, pagename, request):
--- a/MoinMoin/action/login.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/login.py	Sun Feb 18 21:39:36 2007 +0100
@@ -56,7 +56,7 @@
                     if not request.user.valid:
                         error = _("Sorry, login failed.")
 
-            return self.page.send_page(request, msg=error)
+            return self.page.send_page(msg=error)
 
         else: # show login form
             request.emit_http_headers()
--- a/MoinMoin/action/logout.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/logout.py	Sun Feb 18 21:39:36 2007 +0100
@@ -23,5 +23,5 @@
     def handle(self):
         _ = self._
         message = _("You are now logged out.")
-        return self.page.send_page(self.request, msg=message)
+        return self.page.send_page(msg=message)
 
--- a/MoinMoin/action/newpage.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/newpage.py	Sun Feb 18 21:39:36 2007 +0100
@@ -73,7 +73,7 @@
         if error:
             # Send back to the page you came from, with an error msg
             page = Page(self.request, self.referrer)
-            page.send_page(self.request, msg=error)
+            page.send_page(msg=error)
         else:
             # Redirect to new page using edit action. No error checking
             # is needed because it is done later in new request.
--- a/MoinMoin/action/quicklink.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/quicklink.py	Sun Feb 18 21:39:36 2007 +0100
@@ -25,5 +25,5 @@
         if request.user.addQuicklink(pagename):
             msg = _('A quicklink to this page has been added for you.')
 
-    Page(request, pagename).send_page(request, msg=msg)
+    Page(request, pagename).send_page(msg=msg)
 
--- a/MoinMoin/action/refresh.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/refresh.py	Sun Feb 18 21:39:36 2007 +0100
@@ -20,5 +20,5 @@
     from MoinMoin import caching
     caching.CacheEntry(request, arena, key, scope='item').remove()
     caching.CacheEntry(request, arena, "pagelinks", scope='item').remove()
-    request.page.send_page(request)
+    request.page.send_page()
 
--- a/MoinMoin/action/revert.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/revert.py	Sun Feb 18 21:39:36 2007 +0100
@@ -14,7 +14,7 @@
     _ = request.getText
 
     if not request.user.may.revert(pagename):
-        return Page(request, pagename).send_page(request,
+        return Page(request, pagename).send_page(
             msg=_('You are not allowed to revert this page!'))
 
     rev = request.rev
@@ -29,5 +29,5 @@
         # msg contain a unicode string
         savemsg = unicode(msg)
     request.reset()
-    pg.send_page(request, msg=savemsg)
+    pg.send_page(msg=savemsg)
 
--- a/MoinMoin/action/subscribe.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/subscribe.py	Sun Feb 18 21:39:36 2007 +0100
@@ -46,5 +46,5 @@
         if request.user.subscribe(pagename):
             msg = _('You have been subscribed to this page.')
 
-    Page(request, pagename).send_page(request, msg=msg)
+    Page(request, pagename).send_page(msg=msg)
 
--- a/MoinMoin/action/userprefs.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/action/userprefs.py	Sun Feb 18 21:39:36 2007 +0100
@@ -19,5 +19,5 @@
 
 def execute(pagename, request):
     page = wikiutil.getSysPage(request, 'UserPreferences')
-    page.send_page(request)
+    page.send_page()
 
--- a/MoinMoin/macro/Include.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/macro/Include.py	Sun Feb 18 21:39:36 2007 +0100
@@ -218,7 +218,7 @@
         request.redirect(strfile)
         try:
             cid = request.makeUniqueID("Include_%s" % wikiutil.quoteWikinameURL(inc_page.page_name))
-            inc_page.send_page(request, content_only=1, content_id=cid,
+            inc_page.send_page(content_only=1, content_id=cid,
                                omit_footnotes=True)
             result.append(strfile.getvalue())
         finally:
--- a/MoinMoin/macro/RandomQuote.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/macro/RandomQuote.py	Sun Feb 18 21:39:36 2007 +0100
@@ -48,7 +48,7 @@
     quote = random.choice(quotes)
     page.set_raw_body(quote, 1)
     quote = macro.request.redirectedOutput(page.send_page,
-        macro.request, content_only=1, content_id="RandomQuote_%s" % wikiutil.quoteWikinameFS(page.page_name) )
+        content_only=1, content_id="RandomQuote_%s" % wikiutil.quoteWikinameFS(page.page_name) )
 
     return quote
 
--- a/MoinMoin/script/export/dump.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/script/export/dump.py	Sun Feb 18 21:39:36 2007 +0100
@@ -152,7 +152,7 @@
                 request.page = page
                 try:
                     request.reset()
-                    pagehtml = request.redirectedOutput(page.send_page, request, count_hit=0, content_only=1)
+                    pagehtml = request.redirectedOutput(page.send_page, count_hit=0, content_only=1)
                 except:
                     errcnt = errcnt + 1
                     print >>sys.stderr, "*** Caught exception while writing page!"
--- a/MoinMoin/xmlrpc/UpdateGroup.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/xmlrpc/UpdateGroup.py	Sun Feb 18 21:39:36 2007 +0100
@@ -67,7 +67,7 @@
 
     #we need this to update pagelinks cache:
     self.request.args = self.request.form = self.request.setup_args({})
-    self.request.redirectedOutput(page.send_page, self.request, content_only=1)
+    self.request.redirectedOutput(page.send_page, content_only=1)
 
     return xmlrpclib.Boolean(1)
 
--- a/MoinMoin/xmlrpc/__init__.py	Sun Feb 18 21:17:16 2007 +0100
+++ b/MoinMoin/xmlrpc/__init__.py	Sun Feb 18 21:39:36 2007 +0100
@@ -458,8 +458,7 @@
             return self.noSuchPageFault()
 
         # Render page into a buffer
-        result = self.request.redirectedOutput(page.send_page, self.request,
-                                               content_only=1)
+        result = self.request.redirectedOutput(page.send_page, content_only=1)
 
         # Return rendered page
         if self.version == 2: