[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher - BaseRequest.py:1.1.2.28 BaseResponse.py:1.1.2.12 IPublisherResponse.py:1.1.2.6 Publish.py:1.1.2.17 publisher-meta.zcml:1.1.4.2
Shane Hathaway
shane@cvs.zope.org
Fri, 12 Apr 2002 17:31:23 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/Publisher
In directory cvs.zope.org:/tmp/cvs-serv20835/lib/python/Zope/Publisher
Modified Files:
Tag: Zope-3x-branch
BaseRequest.py BaseResponse.py IPublisherResponse.py
Publish.py publisher-meta.zcml
Log Message:
Merged Zope3-Server-Branch.
=== Zope3/lib/python/Zope/Publisher/BaseRequest.py 1.1.2.27 => 1.1.2.28 ===
environment = RequestDataProperty(RequestEnvironment)
- def __init__(self, body_instream, outstream, environ, positional=()):
+ def __init__(self, body_instream, outstream, environ, response=None,
+ positional=()):
self._traversal_stack = []
self._traversed_names = []
self._environ = environ
self._args = positional
- self._response = self._createResponse(outstream)
+ if response is None:
+ self._response = self._createResponse(outstream)
+ else:
+ self._response = response
self._body_instream = body_instream
self._held = ()
=== Zope3/lib/python/Zope/Publisher/BaseResponse.py 1.1.2.11 => 1.1.2.12 ===
exc_info[0], exc_info[1], exc_info[2], 100, self)
+ def internalError(self):
+ 'See Zope.Publisher.IPublisherResponse.IPublisherResponse'
+ pass
+
def retry(self):
'See Zope.Publisher.IPublisherResponse.IPublisherResponse'
return self.__class__(self.outstream)
=== Zope3/lib/python/Zope/Publisher/IPublisherResponse.py 1.1.2.5 => 1.1.2.6 ===
def setBody(result):
- """Set's the response result value.
+ """Sets the response result value.
"""
def handleException(exc_info):
- """Handle an otherwise unhandled exception.
+ """Handles an otherwise unhandled exception.
- The handling of the exception is expected to effect the reponse body.
+ The publication object gets the first chance to handle an exception,
+ and if it doesn't have a good way to do it, it defers to the
+ response. Implementations should set the reponse body.
+ """
+
+ def internalError():
+ """Called when the exception handler bombs.
+
+ Should report back to the client that an internal error occurred.
"""
- # XXX ZopePublication seems to call this, so maybe this should be
- # in an IPublicationResponse interface, but maybe this will change,
- # so we'll apply YAGNI for now.
def outputBody():
- """Output the response to the client
+ """Outputs the response to the client
"""
def retry():
- """Return a retry response
+ """Returns a retry response
- Return a response suitable for repeating the publication attempt.
+ Returns a response suitable for repeating the publication attempt.
"""
=== Zope3/lib/python/Zope/Publisher/Publish.py 1.1.2.16 => 1.1.2.17 ===
#
##############################################################################
-__doc__="""Python Object Publisher -- Publish Python objects on web servers
+"""
+Python Object Publisher -- Publish Python objects on web servers
+
+$Id$
+"""
-$Id$"""
-__version__='$Revision$'[11:-2]
import sys, os
from Exceptions import Retry
@@ -71,6 +73,7 @@
except:
# Bad exception handler or retry method.
# Re-raise after outputting the response.
+ request.getResponse().internalError()
to_raise = sys.exc_info()
break
=== Zope3/lib/python/Zope/Publisher/publisher-meta.zcml 1.1.4.1 => 1.1.4.2 ===
>
- <include package="Zope.Publisher.Browser" file="browser-meta.zcml" />
- <include package="Zope.Publisher.XMLRPC" file="xmlrpc-meta.zcml" />
- <!--include package="Zope.Publisher.SOAP" file="soap-meta.zcml" /-->
+ <include package=".Browser" file="browser-meta.zcml" />
+ <include package=".XMLRPC" file="xmlrpc-meta.zcml" />
+ <!--include package=".SOAP" file="soap-meta.zcml" /-->
+ <include package=".VFS" file="vfs-meta.zcml" />
</zopeConfigure>