[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher - BaseRequest.py:1.4 DefaultPublication.py:1.3 IPublicationRequest.py:1.3 Publish.py:1.4
Jim Fulton
jim@zope.com
Tue, 18 Jun 2002 10:47:37 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/Publisher
In directory cvs.zope.org:/tmp/cvs-serv6342/lib/python/Zope/Publisher
Modified Files:
BaseRequest.py DefaultPublication.py IPublicationRequest.py
Publish.py
Log Message:
Renamed request getResponse method to read-only response property.
=== Zope3/lib/python/Zope/Publisher/BaseRequest.py 1.3 => 1.4 ===
return self._args
- def getResponse(self):
- 'See Zope.Publisher.IPublicationRequest.IPublicationRequest'
+ def _getResponse(self):
return self._response
+
+ response = property(_getResponse)
def getTraversalStack(self):
'See Zope.Publisher.IPublicationRequest.IPublicationRequest'
=== Zope3/lib/python/Zope/Publisher/DefaultPublication.py 1.2 => 1.3 ===
def handleException(self, request, exc_info, retry_allowed=1):
# Let the response handle it as best it can.
- response = request.getResponse()
- response.handleException(exc_info)
+ request.response.handleException(exc_info)
class TestPublication(DefaultPublication):
=== Zope3/lib/python/Zope/Publisher/IPublicationRequest.py 1.2 => 1.3 ===
import IPresentationRequest
+from Interface.Attribute import Attribute
+
class IPublicationRequest(IPresentationRequest):
"""Interface provided by requests to IPublication objects
"""
- def getResponse():
- """Return the request's response object
+ response = Attribute("""the request's response object
Return an IPublisherResponse for the request.
- """
+ """)
def close():
"""Release resources held by the request.
=== Zope3/lib/python/Zope/Publisher/Publish.py 1.3 => 1.4 ===
result = publication.callObject(request, object)
- response = request.getResponse()
+ response = request.response
if result is not response:
response.setBody(result)
@@ -69,13 +69,13 @@
# Bad exception handler or retry method.
# Re-raise after outputting the response.
if handle_errors:
- request.getResponse().internalError()
+ request.response.internalError()
to_raise = sys.exc_info()
break
else:
raise
- response = request.getResponse()
+ response = request.response
response.outputBody()
if to_raise is not None:
raise to_raise[0], to_raise[1], to_raise[2]