[Zope-Checkins] CVS: Zope3/lib/python/Zope/Server - HTTPServer.py:1.1.2.3

Shane Hathaway shane@digicool.com
Fri, 16 Nov 2001 12:27:35 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/Server
In directory cvs.zope.org:/tmp/cvs-serv22541/Server

Modified Files:
      Tag: Zope-3x-branch
	HTTPServer.py 
Log Message:
Match new interface of Publisher


=== Zope3/lib/python/Zope/Server/HTTPServer.py 1.1.2.2 => 1.1.2.3 ===
     "A medusa style handler for zhttp_server"
         
-    def __init__ (self, module, uri_base=None, env=None):
+    def __init__ (self, publication, uri_base=None, env=None):
         """Creates a zope_handler
         
-        module -- string, the name of the module to publish
+        publication -- a implementation of IPublication
         uri_base -- string, the base uri of the published module
                     defaults to '/<module name>' if not given.
         env -- dictionary, environment variables to be overridden.        
                     Replaces standard variables with supplied ones.
         """
         
-        self.module_name=module
+        self.publication = publication
         self.env_override=env or {}
         self.hits = counter.counter()
         # if uri_base is unspecified, assume it
@@ -222,7 +222,7 @@
         zresponse=make_response(request,env)
         zrequest=HTTPRequest(sin, env, zresponse)
         request.channel.current_request=None
-        request.channel.queue.append((self.module_name, zrequest, zresponse))
+        request.channel.queue.append((self.publication, zrequest))
         request.channel.work()
 
     def status(self):
@@ -231,7 +231,7 @@
             <ul>
             <li><b>Published Module:</b> %s
             <li><b>Hits:</b> %s
-            </ul>""" %(self.module_name, self.hits)
+            </ul>""" %(self.publication, self.hits)
             )
 
 
@@ -264,9 +264,9 @@
         if not self.working:
             if self.queue:
                 self.working=1
-                try: module_name, request, response=self.queue.pop(0)
+                try: publication, request = self.queue.pop(0)
                 except: return
-                handle(module_name, request, response)
+                handle(publication, request)
 
     def close(self):
         self.closed=1