changeset 4602:0671f405c7d0

refactored places that required mutability of request.(values|args|form)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 22 Feb 2009 07:54:13 +0100
parents b93cb7a29a13
children 9602b4dc3106
files MoinMoin/Page.py MoinMoin/action/__init__.py
diffstat 2 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Page.py	Sat Feb 21 23:19:29 2009 +0100
+++ b/MoinMoin/Page.py	Sun Feb 22 07:54:13 2009 +0100
@@ -1055,8 +1055,6 @@
             try:
                 self.formatter.set_highlight_re(self.hilite_re)
             except re.error, err:
-                if 'highlight' in request.values:
-                    del request.values['highlight']
                 request.theme.add_msg(_('Invalid highlighting regular expression "%(regex)s": %(error)s') % {
                                           'regex': self.hilite_re,
                                           'error': str(err),
--- a/MoinMoin/action/__init__.py	Sat Feb 21 23:19:29 2009 +0100
+++ b/MoinMoin/action/__init__.py	Sun Feb 22 07:54:13 2009 +0100
@@ -236,7 +236,7 @@
         rev = request.rev or 0
         Page(request, pagename, rev=rev).send_raw()
 
-def do_show(pagename, request, content_only=0, count_hit=1, cacheable=1, print_mode=0):
+def do_show(pagename, request, content_only=0, count_hit=1, cacheable=1, print_mode=0, mimetype=u'text/html'):
     """ show a page, either current revision or the revision given by "rev=" value.
         if count_hit is non-zero, we count the request for statistics.
     """
@@ -244,7 +244,7 @@
     if not request.user.may.read(pagename):
         Page(request, pagename).send_page()
     else:
-        mimetype = request.values.get('mimetype', u"text/html")
+        mimetype = request.values.get('mimetype', mimetype)
         rev = request.rev or 0
         if rev == 0:
             request.cacheable = cacheable
@@ -261,9 +261,7 @@
         It also does not count in statistics and also does not set the cacheable flag.
         DEPRECATED: remove this action when we don't need it any more for compatibility.
     """
-    if 'mimetype' not in request.values:
-        request.values['mimetype'] = u"text/plain"
-    do_show(pagename, request, count_hit=0, cacheable=0)
+    do_show(pagename, request, count_hit=0, cacheable=0, mimetype=u'text/plain')
 
 def do_content(pagename, request):
     """ same as do_show, but we only show the content """