[Zope3-checkins] SVN: Zope3/trunk/src/zope/ Moved the definition of
the interface IHeaderOutput from
Jim Fulton
jim at zope.com
Mon Nov 22 05:11:12 EST 2004
Log message for revision 28486:
Moved the definition of the interface IHeaderOutput from
zope.server.interfaces to zope.publisher.interfaces.http. It isn't
specific to the Zope server. It is needed, for example, by wsgi and by
testing servers.
Changed:
U Zope3/trunk/src/zope/app/tests/functional.py
U Zope3/trunk/src/zope/app/wsgi/__init__.py
U Zope3/trunk/src/zope/publisher/interfaces/http.py
U Zope3/trunk/src/zope/server/http/httptask.py
U Zope3/trunk/src/zope/server/interfaces/__init__.py
-=-
Modified: Zope3/trunk/src/zope/app/tests/functional.py
===================================================================
--- Zope3/trunk/src/zope/app/tests/functional.py 2004-11-21 18:03:50 UTC (rev 28485)
+++ Zope3/trunk/src/zope/app/tests/functional.py 2004-11-22 10:11:12 UTC (rev 28486)
@@ -38,7 +38,7 @@
from zope.publisher.xmlrpc import XMLRPCRequest
from zope.security.interfaces import Forbidden, Unauthorized
from zope.security.management import endInteraction
-import zope.server.interfaces
+import zope.publisher.interfaces.http
from zope.testing import doctest
import zope.app.pluggableauth
@@ -424,7 +424,7 @@
class HTTPHeaderOutput:
- zope.interface.implements(zope.server.interfaces.IHeaderOutput)
+ zope.interface.implements(zope.publisher.interfaces.http.IHeaderOutput)
def __init__(self, protocol, omit):
self.headers = {}
Modified: Zope3/trunk/src/zope/app/wsgi/__init__.py
===================================================================
--- Zope3/trunk/src/zope/app/wsgi/__init__.py 2004-11-21 18:03:50 UTC (rev 28485)
+++ Zope3/trunk/src/zope/app/wsgi/__init__.py 2004-11-22 10:11:12 UTC (rev 28486)
@@ -17,7 +17,7 @@
"""
from zope.interface import implements
from zope.publisher.publish import publish
-from zope.server.interfaces import IHeaderOutput
+from zope.publisher.interfaces.http import IHeaderOutput
from zope.app.publication.httpfactory import HTTPPublicationRequestFactory
Modified: Zope3/trunk/src/zope/publisher/interfaces/http.py
===================================================================
--- Zope3/trunk/src/zope/publisher/interfaces/http.py 2004-11-21 18:03:50 UTC (rev 28485)
+++ Zope3/trunk/src/zope/publisher/interfaces/http.py 2004-11-22 10:11:12 UTC (rev 28486)
@@ -225,7 +225,43 @@
"""Causes a redirection without raising an error.
"""
+class IHeaderOutput(Interface):
+ """Interface for setting HTTP response headers.
+ This allows the HTTP server and the application to both set response
+ headers.
+
+ zope.publisher.http.HTTPResponse is optionally passed an
+ object which implements this interface in order to intermingle
+ its headers with the HTTP server's response headers,
+ and for the purpose of better logging.
+ """
+
+ def setResponseStatus(status, reason):
+ """Sets the status code and the accompanying message.
+ """
+
+ def setResponseHeaders(mapping):
+ """Sets headers. The headers must be Correctly-Cased.
+ """
+
+ def appendResponseHeaders(lst):
+ """Sets headers that can potentially repeat.
+
+ Takes a list of strings.
+ """
+
+ def wroteResponseHeader():
+ """Returns a flag indicating whether the response
+
+ header has already been sent.
+ """
+
+ def setAuthUserName(name):
+ """Sets the name of the authenticated user so the name can be logged.
+ """
+
+
class IHTTPResponse(IResponse):
"""An object representation of an HTTP response.
Modified: Zope3/trunk/src/zope/server/http/httptask.py
===================================================================
--- Zope3/trunk/src/zope/server/http/httptask.py 2004-11-21 18:03:50 UTC (rev 28485)
+++ Zope3/trunk/src/zope/server/http/httptask.py 2004-11-22 10:11:12 UTC (rev 28486)
@@ -22,8 +22,7 @@
import time
from zope.server.http.http_date import build_http_date
-
-from zope.server.interfaces import IHeaderOutput
+from zope.publisher.interfaces.http import IHeaderOutput
from zope.server.interfaces import ITask
from zope.interface import implements
@@ -88,27 +87,27 @@
pass
def setResponseStatus(self, status, reason):
- """See zope.server.interfaces.IHeaderOutput"""
+ """See zope.publisher.interfaces.http.IHeaderOutput"""
self.status = status
self.reason = reason
def setResponseHeaders(self, mapping):
- """See zope.server.interfaces.IHeaderOutput"""
+ """See zope.publisher.interfaces.http.IHeaderOutput"""
self.response_headers.update(mapping)
def appendResponseHeaders(self, lst):
- """See zope.server.interfaces.IHeaderOutput"""
+ """See zope.publisher.interfaces.http.IHeaderOutput"""
accum = self.accumulated_headers
if accum is None:
self.accumulated_headers = accum = []
accum.extend(lst)
def wroteResponseHeader(self):
- """See zope.server.interfaces.IHeaderOutput"""
+ """See zope.publisher.interfaces.http.IHeaderOutput"""
return self.wrote_header
def setAuthUserName(self, name):
- """See zope.server.interfaces.IHeaderOutput"""
+ """See zope.publisher.interfaces.http.IHeaderOutput"""
self.auth_user_name = name
def prepareResponseHeaders(self):
Modified: Zope3/trunk/src/zope/server/interfaces/__init__.py
===================================================================
--- Zope3/trunk/src/zope/server/interfaces/__init__.py 2004-11-21 18:03:50 UTC (rev 28485)
+++ Zope3/trunk/src/zope/server/interfaces/__init__.py 2004-11-22 10:11:12 UTC (rev 28486)
@@ -134,43 +134,6 @@
a different thread.
"""
-class IHeaderOutput(Interface):
- """Interface for setting HTTP response headers.
-
- This allows the HTTP server and the application to both set response
- headers.
-
- zope.publisher.http.HTTPResponse is optionally passed an
- object which implements this interface in order to intermingle
- its headers with the HTTP server's response headers,
- and for the purpose of better logging.
- """
-
- def setResponseStatus(status, reason):
- """Sets the status code and the accompanying message.
- """
-
- def setResponseHeaders(mapping):
- """Sets headers. The headers must be Correctly-Cased.
- """
-
- def appendResponseHeaders(lst):
- """Sets headers that can potentially repeat.
-
- Takes a list of strings.
- """
-
- def wroteResponseHeader():
- """Returns a flag indicating whether the response
-
- header has already been sent.
- """
-
- def setAuthUserName(name):
- """Sets the name of the authenticated user so the name can be logged.
- """
-
-
class IDispatcherEventHandler(Interface):
"""The Dispatcher can receive several different types of events. This
interface describes the necessary methods that handle these common
More information about the Zope3-Checkins
mailing list