changeset 1068:ecece5db5288

use emit_http_headers
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 27 Jul 2006 01:18:14 +0200
parents 5bf357a720e7
children d7227430c305
files MoinMoin/action/AttachFile.py MoinMoin/action/Despam.py MoinMoin/action/LikePages.py MoinMoin/action/LocalSiteMap.py MoinMoin/action/MyPages.py MoinMoin/action/SubscribeUser.py MoinMoin/action/__init__.py MoinMoin/action/backup.py MoinMoin/action/diff.py MoinMoin/action/edit.py MoinMoin/action/fckdialog.py MoinMoin/action/fullsearch.py MoinMoin/action/info.py MoinMoin/action/links.py MoinMoin/action/login.py MoinMoin/action/rss_rc.py MoinMoin/action/sitemap.py MoinMoin/action/test.py MoinMoin/action/thread_monitor.py MoinMoin/action/titleindex.py MoinMoin/stats/hitcounts.py MoinMoin/stats/pagesize.py MoinMoin/stats/useragents.py MoinMoin/xmlrpc/__init__.py
diffstat 24 files changed, 39 insertions(+), 45 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/action/AttachFile.py	Thu Jul 27 01:18:14 2006 +0200
@@ -493,7 +493,7 @@
     elif request.form['do'][0] == 'savedrawing':
         if request.user.may.write(pagename):
             save_drawing(pagename, request)
-            request.http_headers()
+            request.emit_http_headers()
             request.write("OK")
         else:
             msg = _('You are not allowed to save a drawing on this page.')
@@ -541,7 +541,7 @@
 def upload_form(pagename, request, msg=''):
     _ = request.getText
 
-    request.http_headers()
+    request.emit_http_headers()
     # Use user interface language for this generated page
     request.setContentLanguage(request.lang)
     request.theme.send_title(_('Attachments for "%(pagename)s"') % {'pagename': pagename}, pagename=pagename, msg=msg)
@@ -653,8 +653,7 @@
 
     mt = wikiutil.MimeType(filename=filename)
 
-    # send header
-    request.http_headers([
+    request.emit_http_headers([
         "Content-Type: %s" % mt.content_type(),
         "Content-Length: %d" % os.path.getsize(fpath),
         # TODO: fix the encoding here, plain 8 bit is not allowed according to the RFCs
@@ -824,7 +823,7 @@
     if not filename: return
 
     # send header & title
-    request.http_headers()
+    request.emit_http_headers()
     # Use user interface language for this generated page
     request.setContentLanguage(request.lang)
     title = _('attachment:%(filename)s of %(pagename)s', formatted=True) % {
--- a/MoinMoin/action/Despam.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/action/Despam.py	Thu Jul 27 01:18:14 2006 +0200
@@ -169,7 +169,7 @@
        # request.form.get('timestamp', [None])[0]
     ok = request.form.get('ok', [0])[0]
 
-    request.http_headers()
+    request.emit_http_headers()
     request.theme.send_title("Despam", pagename=pagename)
     # Start content (important for RTL support)
     request.write(request.formatter.startContent("content"))
--- a/MoinMoin/action/LikePages.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/action/LikePages.py	Thu Jul 27 01:18:14 2006 +0200
@@ -41,7 +41,7 @@
         return
 
     # more than one match, list 'em
-    request.http_headers()
+    request.emit_http_headers()
 
     # This action generate data using the user language
     request.setContentLanguage(request.lang)
--- a/MoinMoin/action/LocalSiteMap.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/action/LocalSiteMap.py	Thu Jul 27 01:18:14 2006 +0200
@@ -28,7 +28,7 @@
 
 def execute(pagename, request):
     _ = request.getText
-    request.http_headers()
+    request.emit_http_headers()
 
     # This action generate data using the user language
     request.setContentLanguage(request.lang)
--- a/MoinMoin/action/MyPages.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/action/MyPages.py	Thu Jul 27 01:18:14 2006 +0200
@@ -58,7 +58,7 @@
 
     from MoinMoin.Page import Page
     from MoinMoin.parser.text_moin_wiki import Parser as WikiParser
-    request.http_headers()
+    request.emit_http_headers()
 
     # This action generate data using the user language
     request.setContentLanguage(request.lang)
--- a/MoinMoin/action/SubscribeUser.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/action/SubscribeUser.py	Thu Jul 27 01:18:14 2006 +0200
@@ -17,7 +17,7 @@
 
 def show_form(pagename, request):
     _ = request.getText
-    request.http_headers()
+    request.emit_http_headers()
     request.theme.send_title(_("Subscribe users to the page %s") % pagename, pagename=pagename)
 
     request.write("""
@@ -32,7 +32,7 @@
 
 def show_result(pagename, request):
     _ = request.getText
-    request.http_headers()
+    request.emit_http_headers()
 
     request.theme.send_title(_("Subscribed for %s:") % pagename, pagename=pagename)
 
--- a/MoinMoin/action/__init__.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/action/__init__.py	Thu Jul 27 01:18:14 2006 +0200
@@ -252,7 +252,7 @@
 
 def do_content(pagename, request):
     """ same as do_show, but we only show the content """
-    request.http_headers()
+    request.emit_http_headers()
     page = Page(request, pagename)
     request.write('<!-- Transclusion of %s -->' % request.getQualifiedURL(page.url(request)))
     page.send_page(request, count_hit=0, content_only=1)
@@ -426,7 +426,7 @@
     """ dump the form data we received in this request for debugging """
     data = util.dumpFormData(request.form)
 
-    request.http_headers()
+    request.emit_http_headers()
     request.write("<html><body>%s</body></html>" % data)
 
 
--- a/MoinMoin/action/backup.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/action/backup.py	Thu Jul 27 01:18:14 2006 +0200
@@ -28,7 +28,7 @@
     """ Send compressed tar file """
     dateStamp = time.strftime("%Y-%m-%d--%H-%M-%S-UTC", time.gmtime())
     filename = "%s-%s.tar.%s" % (request.cfg.siteid, dateStamp, request.cfg.backup_compression)
-    request.http_headers([
+    request.emit_http_headers([
         "Content-Type: application/octet-stream",
         "Content-Disposition: inline; filename=\"%s\"" % filename, ])
 
@@ -70,7 +70,7 @@
 
 def sendBackupForm(request, pagename):
     _ = request.getText
-    request.http_headers()
+    request.emit_http_headers()
     request.setContentLanguage(request.lang)
     title = _('Wiki Backup / Restore')
     request.theme.send_title(title, form=request.form, pagename=pagename)
--- a/MoinMoin/action/diff.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/action/diff.py	Thu Jul 27 01:18:14 2006 +0200
@@ -71,7 +71,7 @@
     # This action generate content in the user language
     request.setContentLanguage(request.lang)
 
-    request.http_headers()
+    request.emit_http_headers()
     request.theme.send_title(_('Diff for "%s"') % (pagename,), pagename=pagename, allow_doubleclick=1)
 
     if rev1 > 0 and rev2 > 0 and rev1 > rev2 or rev1 == 0 and rev2 > 0:
--- a/MoinMoin/action/edit.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/action/edit.py	Thu Jul 27 01:18:14 2006 +0200
@@ -137,7 +137,7 @@
         try:
             still_conflict = wikiutil.containsConflictMarker(savetext)
             pg.setConflict(still_conflict)
-            request.http_headers() # XXX WHY? XXX
+            request.emit_http_headers() # XXX WHY? XXX
             savemsg = pg.saveText(savetext, rev, trivial=trivial, comment=comment)
         except pg.EditConflict, e:
             msg = e.message
--- a/MoinMoin/action/fckdialog.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/action/fckdialog.py	Thu Jul 27 01:18:14 2006 +0200
@@ -15,7 +15,7 @@
 
 def macro_dialog(request):
     help = get_macro_help(request)
-    request.http_headers()
+    request.emit_http_headers()
     request.write(
         '''<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <html>
@@ -169,7 +169,7 @@
         pages = [p.page_name for p in searchresult.hits]
     else:
         pages = [name]
-    request.http_headers()
+    request.emit_http_headers()
     request.write(
         '''<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <html>
@@ -200,7 +200,7 @@
 ''' % "".join(["<option>%s</option>\n" % p for p in pages]))
 
 def link_dialog(request):
-    request.http_headers()
+    request.emit_http_headers()
     # list of wiki pages
     name = request.form.get("pagename", [""])[0]
     if name:
@@ -246,7 +246,7 @@
         scriptname += "/"
     action = scriptname
     basepage = request.page.page_name.encode(config.charset)
-    request.http_headers()
+    request.emit_http_headers()
     request.write('''
 <!--
  * FCKeditor - The text editor for internet
@@ -367,7 +367,7 @@
 ##############################################################################
 
 def attachment_dialog(request):
-    request.http_headers()
+    request.emit_http_headers()
     # list of wiki pages
     name = request.form.get("pagename", [""])[0]
     if name:
@@ -397,7 +397,7 @@
     if not scriptname or scriptname[-1] != "/":
         scriptname += "/"
     action = scriptname
-    request.http_headers()
+    request.emit_http_headers()
     request.write('''
 <!--
  * FCKeditor - The text editor for internet
@@ -462,7 +462,7 @@
 ##############################################################################
 
 def image_dialog(request):
-    request.http_headers()
+    request.emit_http_headers()
     url_prefix = request.cfg.url_prefix
     request.write('''
 <!--
--- a/MoinMoin/action/fullsearch.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/action/fullsearch.py	Thu Jul 27 01:18:14 2006 +0200
@@ -50,8 +50,7 @@
     if len(striped) == 0:
         err = _('Please use a more selective search term instead '
                 'of {{{"%s"}}}') % needle
-        # send http headers
-        request.http_headers()
+        request.emit_http_headers()
         Page(request, pagename).send_page(request, msg=err)
         return
 
@@ -74,8 +73,7 @@
             request.http_redirect(url)
             return
 
-    # send http headers
-    request.http_headers()
+    request.emit_http_headers()
 
     # This action generate data using the user language
     request.setContentLanguage(request.lang)
--- a/MoinMoin/action/info.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/action/info.py	Thu Jul 27 01:18:14 2006 +0200
@@ -206,7 +206,7 @@
     qpagename = wikiutil.quoteWikinameURL(pagename)
     title = page.split_title(request)
 
-    request.http_headers()
+    request.emit_http_headers()
 
     # This action uses page or wiki language TODO: currently
     # page.language is broken and not available now, when we fix it,
--- a/MoinMoin/action/links.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/action/links.py	Thu Jul 27 01:18:14 2006 +0200
@@ -19,7 +19,7 @@
     else:
         mimetype = "text/html"
 
-    request.http_headers(["Content-Type: %s; charset=%s" % (mimetype, config.charset)])
+    request.emit_http_headers(["Content-Type: %s; charset=%s" % (mimetype, config.charset)])
 
     if mimetype == "text/html":
         request.theme.send_title(_('Full Link List for "%s"') % request.cfg.sitename)
--- a/MoinMoin/action/login.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/action/login.py	Thu Jul 27 01:18:14 2006 +0200
@@ -59,7 +59,7 @@
             return self.page.send_page(request, msg=error)
 
         else: # show login form
-            request.http_headers()
+            request.emit_http_headers()
             request.theme.send_title(_("Login"), pagename=self.pagename)
             # Start content (important for RTL support)
             request.write(request.formatter.startContent("content"))
--- a/MoinMoin/action/rss_rc.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/action/rss_rc.py	Thu Jul 27 01:18:14 2006 +0200
@@ -220,6 +220,6 @@
         httpheaders.append("Last-Modified: %s" % timefuncs.formathttpdate(lastmod))
 
     # send the generated XML document
-    request.http_headers(httpheaders)
+    request.emit_http_headers(httpheaders)
     request.write(out.getvalue())
 
--- a/MoinMoin/action/sitemap.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/action/sitemap.py	Thu Jul 27 01:18:14 2006 +0200
@@ -64,7 +64,7 @@
     request.user.datetime_fmt = datetime_fmt
     base = request.getBaseURL()
 
-    request.http_headers(["Content-Type: text/xml; charset=UTF-8"])
+    request.emit_http_headers(["Content-Type: text/xml; charset=UTF-8"])
 
     # we emit a piece of data so other side doesn't get bored:
     request.write("""<?xml version="1.0" encoding="UTF-8"?>\r\n""")
--- a/MoinMoin/action/test.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/action/test.py	Thu Jul 27 01:18:14 2006 +0200
@@ -105,7 +105,7 @@
     def do_action(self):
         """ run tests """
         request = self.request
-        request.http_headers(["Content-type: text/plain; charset=%s" % config.charset])
+        request.emit_http_headers(["Content-type: text/plain; charset=%s" % config.charset])
         request.write('MoinMoin Diagnosis\n======================\n\n')
         runTest(request)
         return True, ""
--- a/MoinMoin/action/thread_monitor.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/action/thread_monitor.py	Thu Jul 27 01:18:14 2006 +0200
@@ -27,11 +27,11 @@
     else:
         dump_fname = "nowhere"
 
-    request.http_headers()
+    request.emit_http_headers()
     request.write('<html><body>A dump has been saved to %s.</body></html>' % dump_fname)
 
 def execute_wiki(pagename, request):
-    request.http_headers()
+    request.emit_http_headers()
 
     request.theme.send_title("Thread monitor")
     request.write('<pre>')
--- a/MoinMoin/action/titleindex.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/action/titleindex.py	Thu Jul 27 01:18:14 2006 +0200
@@ -22,7 +22,7 @@
     else:
         mimetype = "text/plain"
 
-    request.http_headers(["Content-Type: %s; charset=%s" % (mimetype, config.charset)])
+    request.emit_http_headers(["Content-Type: %s; charset=%s" % (mimetype, config.charset)])
 
     # Get list of user readable pages
     pages = request.rootpage.getPageList()
--- a/MoinMoin/stats/hitcounts.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/stats/hitcounts.py	Thu Jul 27 01:18:14 2006 +0200
@@ -243,12 +243,11 @@
         (request.cfg.chart_options['width'], request.cfg.chart_options['height']),
         image, days)
 
-    # send HTTP headers
     headers = [
         "Content-Type: image/gif",
         "Content-Length: %d" % len(image.getvalue()),
     ]
-    request.http_headers(headers)
+    request.emit_http_headers(headers)
 
     # copy the image
     image.reset()
--- a/MoinMoin/stats/pagesize.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/stats/pagesize.py	Thu Jul 27 01:18:14 2006 +0200
@@ -114,12 +114,11 @@
         (request.cfg.chart_options['width'], request.cfg.chart_options['height']),
         image, labels)
 
-    # send HTTP headers
     headers = [
         "Content-Type: image/gif",
         "Content-Length: %d" % len(image.getvalue()),
     ]
-    request.http_headers(headers)
+    request.emit_http_headers(headers)
 
     # copy the image
     image.reset()
--- a/MoinMoin/stats/useragents.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/stats/useragents.py	Thu Jul 27 01:18:14 2006 +0200
@@ -172,12 +172,11 @@
         (request.cfg.chart_options['width'], request.cfg.chart_options['height']),
         image, labels)
 
-    # send HTTP headers
     headers = [
         "Content-Type: image/gif",
         "Content-Length: %d" % len(image.getvalue()),
     ]
-    request.http_headers(headers)
+    request.emit_http_headers(headers)
 
     # copy the image
     image.reset()
--- a/MoinMoin/xmlrpc/__init__.py	Thu Jul 27 00:27:51 2006 +0200
+++ b/MoinMoin/xmlrpc/__init__.py	Thu Jul 27 01:18:14 2006 +0200
@@ -131,8 +131,8 @@
             # serialize it
             response = xmlrpclib.dumps(response, methodresponse=1)
 
-        self.request.http_headers([
-            "Content-Type: text/xml;charset=utf-8",
+        self.request.emit_http_headers([
+            "Content-Type: text/xml; charset=utf-8",
             "Content-Length: %d" % len(response),
         ])
         self.request.write(response)