[Zope-CMF] [dev] Document.get_size considered dumb

Tres Seaver tseaver at zope.com
Wed Sep 22 10:56:56 EDT 2004


I would like to modify the implementation of 
Products.CMFDefault.Document.get_size as follows:


--- CMFDefault/Document.py      7 Sep 2004 08:47:54 -0000       1.69.2.2
+++ CMFDefault/Document.py      22 Sep 2004 14:53:13 -0000
@@ -415,6 +415,6 @@
      security.declareProtected(View, 'get_size')
      def get_size( self ):
          """ Used for FTP and apparently the ZMI now too """
-        return len(self.manage_FTPget())
+        return len(self.text)

  InitializeClass(Document)

The current behavior tries to ensure that 'get_size' returns exactly the 
same value as the length of the decorated source text.  The only 
dependent I know of for that behavir is webdav's HEAD;  I have no 
problem with "breaking" that, because there is no guarantee that HEAD 
and GET will return the same values between two requests, anyway.

Are there any other clients out there who care about 'get_size'?  If 
noone objects, I will check it in on Friday (I may make the size cached, 
as well).

Tres.
-- 
===============================================================
Tres Seaver                                tseaver at zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com



More information about the Zope-CMF mailing list