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

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


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

Modified Files:
	BaseRequest.py IApplicationRequest.py 
Log Message:
Changed request getBody and getBodyFile methods to
body and bodyFile read-only properties.


=== Zope3/lib/python/Zope/Publisher/BaseRequest.py 1.4 => 1.5 ===
     # from: Zope.Publisher.IApplicationRequest.IApplicationRequest
 
-    def getBody(self):
-        'See Zope.Publisher.IApplicationRequest.IApplicationRequest'
+    def _getBody(self):
         body = getattr(self, '_body', None)
         if body is None:
             s = self._body_instream
@@ -213,9 +212,13 @@
             self._body = body
         return body
 
-    def getBodyFile(self):
+    body = property(_getBody)
+
+    def _getBodyFile(self):
         'See Zope.Publisher.IApplicationRequest.IApplicationRequest'
         return self._body_instream
+
+    bodyFile = property(_getBodyFile)
 
     ######################################
     # from: Interface.Common.Mapping.IEnumerableMapping


=== Zope3/lib/python/Zope/Publisher/IApplicationRequest.py 1.2 => 1.3 ===
     """
 
-    def getBody():
-        """Return the body of the request as a string
-        """
+    body = Attribute("""the body of the request as a string""")
         
-
-    def getBodyFile():
-        """Return the body of the request as a file
-        """
+    bodyFile = Attribute("""the body of the request as a file""")
 
     def __getitem__(key):
         """Return request data