diff roundup/cgi_client.py @ 343:ab16997d9cda

Started work on supporting a pop3-fetching server Fixed bugs: . [SF#477104] HTML tag error in roundup-server . [SF#477107] HTTP header problem
author Richard Jones <richard@users.sourceforge.net>
date Thu, 01 Nov 2001 22:04:37 +0000
parents 4609a1ea94ff
children db8514399149
line wrap: on
line diff
--- a/roundup/cgi_client.py	Wed Oct 31 06:58:51 2001 +0000
+++ b/roundup/cgi_client.py	Thu Nov 01 22:04:37 2001 +0000
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: cgi_client.py,v 1.44 2001-10-28 23:03:08 richard Exp $
+# $Id: cgi_client.py,v 1.45 2001-11-01 22:04:37 richard Exp $
 
 import os, cgi, pprint, StringIO, urlparse, re, traceback, mimetypes
 import base64, Cookie, time
@@ -52,14 +52,13 @@
     ANONYMOUS_ACCESS = 'deny'        # one of 'deny', 'allow'
     ANONYMOUS_REGISTER = 'deny'      # one of 'deny', 'allow'
 
-    def __init__(self, instance, out, env):
+    def __init__(self, instance, request, env):
         self.instance = instance
-        self.out = out
+        self.request = request
         self.env = env
         self.path = env['PATH_INFO']
         self.split_path = self.path.split('/')
 
-        self.headers_done = 0
         self.form = cgi.FieldStorage(environ=env)
         self.headers_done = 0
         self.debug = 0
@@ -68,11 +67,14 @@
         return self.db.user.lookup(self.user)
 
     def header(self, headers={'Content-Type':'text/html'}):
+        '''Put up the appropriate header.
+        '''
         if not headers.has_key('Content-Type'):
             headers['Content-Type'] = 'text/html'
+        self.request.send_response(200)
         for entry in headers.items():
-            self.out.write('%s: %s\n'%entry)
-        self.out.write('\n')
+            self.request.send_header(*entry)
+        self.request.end_headers()
         self.headers_done = 1
 
     def pagehead(self, title, message=None):
@@ -152,7 +154,7 @@
     def write(self, content):
         if not self.headers_done:
             self.header()
-        self.out.write(content)
+        self.request.wfile.write(content)
 
     def index_arg(self, arg):
         ''' handle the args to index - they might be a list from the form
@@ -874,6 +876,9 @@
 
 #
 # $Log: not supported by cvs2svn $
+# Revision 1.44  2001/10/28 23:03:08  richard
+# Added more useful header to the classic schema.
+#
 # Revision 1.43  2001/10/24 00:01:42  richard
 # More fixes to lockout logic.
 #

Roundup Issue Tracker: http://roundup-tracker.org/