[Zope3-checkins] SVN: Zope3/trunk/src/zope/server/ftp/ Fixed issue 452 and adjusted the tests. The FTP publisher code still used

Stephan Richter srichter at cosmos.phy.tufts.edu
Mon Sep 19 14:47:29 EDT 2005


Log message for revision 38527:
  Fixed issue 452 and adjusted the tests. The FTP publisher code still used 
  the old API.
  

Changed:
  U   Zope3/trunk/src/zope/server/ftp/publisher.py
  U   Zope3/trunk/src/zope/server/ftp/tests/test_publisher.py

-=-
Modified: Zope3/trunk/src/zope/server/ftp/publisher.py
===================================================================
--- Zope3/trunk/src/zope/server/ftp/publisher.py	2005-09-19 18:20:21 UTC (rev 38526)
+++ Zope3/trunk/src/zope/server/ftp/publisher.py	2005-09-19 18:47:29 UTC (rev 38527)
@@ -102,10 +102,9 @@
             env['path'], env['name'] = posixpath.split(path)
         else:
             env['path'] = path
-            
+
         env['credentials'] = self.credentials
-        # NoOutput avoids creating a black hole.
-        request = self.request_factory(StringIO(''), NoOutput(), env)
+        request = self.request_factory(StringIO(''), env)
 
         # Note that publish() calls close() on request, which deletes the
         # response from the request, so that we need to keep track of it.
@@ -123,19 +122,6 @@
         return path
 
 
-class NoOutput(object):
-    """An output stream lookalike that warns you if you try to
-    dump anything into it."""
-
-    def write(self, data):
-        raise RuntimeError("Not a writable stream")
-
-    def flush(self):
-        pass
-
-    close = flush
-
-
 class PublisherFTPServer(FTPServer):
     """Generic FTP Server"""
 

Modified: Zope3/trunk/src/zope/server/ftp/tests/test_publisher.py
===================================================================
--- Zope3/trunk/src/zope/server/ftp/tests/test_publisher.py	2005-09-19 18:20:21 UTC (rev 38526)
+++ Zope3/trunk/src/zope/server/ftp/tests/test_publisher.py	2005-09-19 18:47:29 UTC (rev 38527)
@@ -26,7 +26,7 @@
 
     def rename(self, path, old, new):
         return demofs.DemoFileSystem.rename(
-            self, "%s/%s" % (path, old), "%s/%s" % (path, new)) 
+            self, "%s/%s" % (path, old), "%s/%s" % (path, new))
 
 class Publication(object):
 
@@ -35,7 +35,7 @@
 
     def beforeTraversal(self, request):
         pass
-    
+
     def getApplication(self, request):
         return self.root
 
@@ -56,11 +56,11 @@
 
     def handleException(self, object, request, info, retry_allowed=True):
         request.response._exc = info[:2]
-        
 
+
 class Request(object):
 
-    def __init__(self, input, output, env):
+    def __init__(self, input, env):
         self.env = env
         self.response = Response()
         self.user = env['credentials']
@@ -93,8 +93,8 @@
     def __init__(self, root):
         self.pub = Publication(root)
 
-    def __call__(self, input, output, env):
-        r = Request(input, output, env)
+    def __call__(self, input, env):
+        r = Request(input, env)
         r.publication = self.pub
         return r
 



More information about the Zope3-Checkins mailing list