[Erp5-report] r20369 - /erp5/trunk/products/ERP5/Document/Document.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Apr 9 11:00:54 CEST 2008


Author: nicolas
Date: Wed Apr  9 11:00:52 2008
New Revision: 20369

URL: http://svn.erp5.org?rev=20369&view=rev
Log:
Add missing cached_mime, replace hasattr by getattr

Modified:
    erp5/trunk/products/ERP5/Document/Document.py

Modified: erp5/trunk/products/ERP5/Document/Document.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Document.py?rev=20369&r1=20368&r2=20369&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Document.py (original)
+++ erp5/trunk/products/ERP5/Document/Document.py Wed Apr  9 11:00:52 2008
@@ -136,16 +136,19 @@
     self._cached_time = PersistentMapping()
     self._cached_data = PersistentMapping()
     self._cached_size = PersistentMapping()
+    self._cached_mime = PersistentMapping()
 
   security.declareProtected(Permissions.View, 'updateConversionCache')
   def updateConversionCache(self):
     aself = aq_base(self)
-    if not hasattr(aself, '_cached_time') or self._cached_time is None:
+    if getattr(aself, '_cached_time', None) is None or self._cached_time is None:
       self._cached_time = PersistentMapping()
-    if not hasattr(aself, '_cached_data') or self._cached_data is None:
+    if getattr(aself, '_cached_data', None) is None or self._cached_data is None:
       self._cached_data = PersistentMapping()
-    if not hasattr(aself, '_cached_size') or self._cached_size is None:
+    if getattr(aself, '_cached_size', None) is None or self._cached_size is None:
       self._cached_size = PersistentMapping()
+    if getattr(aself, '_cached_mime', None) is None or self._cached_mime is None:
+      self._cached_mime = PersistentMapping()
 
   security.declareProtected(Permissions.View, 'hasConversion')
   def hasConversion(self, **format):




More information about the Erp5-report mailing list