[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/debug/debug.py Updated to reflect recent changes in the publisher.

Jim Fulton jim at zope.com
Thu Sep 29 05:12:42 EDT 2005


Log message for revision 38681:
  Updated to reflect recent changes in the publisher.
  

Changed:
  U   Zope3/trunk/src/zope/app/debug/debug.py

-=-
Modified: Zope3/trunk/src/zope/app/debug/debug.py
===================================================================
--- Zope3/trunk/src/zope/app/debug/debug.py	2005-09-29 09:12:36 UTC (rev 38680)
+++ Zope3/trunk/src/zope/app/debug/debug.py	2005-09-29 09:12:41 UTC (rev 38681)
@@ -92,17 +92,22 @@
 
         return request
 
-    def publish(self, path='/', stdin='', stdout=None, *args, **kw):
+    def publish(self, path='/', stdin='', *args, **kw):
         t, c = time.time(), time.clock()
 
-        if stdout is None:
-            stdout = StringIO()
-
-        request = self._request(path, stdin, stdout, *args, **kw)
+        request = self._request(path, stdin, *args, **kw)
         getStatus = getattr(request.response, 'getStatus', lambda: None)
         _publish(request)
-        stdout.seek(0)
-        print stdout.read()
+
+        # XXX need to stop writing things like this!!!
+
+        headers = request.response.getHeaders()
+        headers.sort()
+        print 'Status %s\r\n%s\r\n\r\n%s' % (
+            request.response.getStatusString(),
+            '\r\n'.join([("%s: %s" % h) for h in headers]),
+            request.response.consumeBody(),
+            )
         return time.time()-t, time.clock()-c, getStatus()
 
     def run(self, *args, **kw):



More information about the Zope3-Checkins mailing list