[Zope-Checkins] CVS: Zope3/lib/python/Zope/Publisher - BaseRequest.py:1.3 IPublisherRequest.py:1.3 Publish.py:1.3

Jim Fulton jim@zope.com
Tue, 18 Jun 2002 10:38:25 -0400


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

Modified Files:
	BaseRequest.py IPublisherRequest.py Publish.py 
Log Message:
Changed the request 'getPublication' method to a read-only
'publication' property.


=== Zope3/lib/python/Zope/Publisher/BaseRequest.py 1.2 => 1.3 ===
     # from: Zope.Publisher.IPublisherRequest.IPublisherRequest
 
-    def getPublication(self):
+    def _getPublication(self):
         'See Zope.Publisher.IPublisherRequest.IPublisherRequest'
         return getattr(self, '_publication', None)
 
+    publication = property(_getPublication)
+
+
     def processInputs(self):
         'See Zope.Publisher.IPublisherRequest.IPublisherRequest'
         # Nothing to do here
@@ -108,7 +111,7 @@
     def traverse(self, object):
         'See Zope.Publisher.IPublisherRequest.IPublisherRequest'
 
-        publication = self.getPublication()
+        publication = self.publication
 
         traversal_stack = self._traversal_stack
         traversed_names = self._traversed_names


=== Zope3/lib/python/Zope/Publisher/IPublisherRequest.py 1.2 => 1.3 ===
 
 from IPublicationRequest import IPublicationRequest
+from Interface.Attribute import Attribute
 
 class IPublisherRequest(IPublicationRequest):
     """Request interface use by the publisher
@@ -43,12 +44,11 @@
         Return a request suitable for repeating the publication attempt.
         """
 
-    def getPublication():
-        """Return the request's publication object
+    publication = Attribute("""the request's publication object
 
         The publication object, an IRequestPublication provides
         application-specific functionality hooks.
-        """
+        """)
 
     def setPublication(publication):
         """Set the request's publication object


=== Zope3/lib/python/Zope/Publisher/Publish.py 1.2 => 1.3 ===
         to_raise = None
         while 1:
-            publication = request.getPublication()
+            publication = request.publication
             try:
                 try:
                     try:
@@ -58,7 +58,7 @@
                         request = newrequest
                     elif handle_errors:
                         # Output the original exception.
-                        publication = request.getPublication()
+                        publication = request.publication
                         publication.handleException(
                             request, retryException.getOriginalException(), 0)
                         break