[Erp5-report] r35752 nicolas - in /erp5/trunk/products/ERP5: Document/ interfaces/

nobody at svn.erp5.org nobody at svn.erp5.org
Fri May 28 18:21:22 CEST 2010


Author: nicolas
Date: Fri May 28 18:21:22 2010
New Revision: 35752

URL: http://svn.erp5.org?rev=35752&view=rev
Log:
Unify usage if format == None.
If format is None it means that we do not want to change the format
and return the raw data or a resized image in same format.

Modified:
    erp5/trunk/products/ERP5/Document/Image.py
    erp5/trunk/products/ERP5/Document/TextDocument.py
    erp5/trunk/products/ERP5/interfaces/document.py

Modified: erp5/trunk/products/ERP5/Document/Image.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Image.py?rev=35752&r1=35751&r2=35752&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Image.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Image.py [utf8] Fri May 28 18:21:22 2010
@@ -275,7 +275,7 @@
     return links
 
   security.declareProtected('Access contents information', 'displayMap')
-  def displayMap(self, exclude=None, format='', quality=DEFAULT_QUALITY,
+  def displayMap(self, exclude=None, format=None, quality=DEFAULT_QUALITY,\
                                                               resolution=None):
     """Return list of displays with size info."""
     displays = []

Modified: erp5/trunk/products/ERP5/Document/TextDocument.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/TextDocument.py?rev=35752&r1=35751&r2=35752&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/TextDocument.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/TextDocument.py [utf8] Fri May 28 18:21:22 2010
@@ -142,9 +142,6 @@
       if not format:
         # can return document without conversion
         return src_mimetype, self.getTextContent()
-      # Return the raw content
-      if format == 'raw':
-        return 'text/plain', self.getTextContent()
       portal = self.getPortalObject()
       mime_type = getToolByName(portal, 'mimetypes_registry').\
                                             lookupExtension('name.%s' % format)

Modified: erp5/trunk/products/ERP5/interfaces/document.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/interfaces/document.py?rev=35752&r1=35751&r2=35752&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/interfaces/document.py [utf8] (original)
+++ erp5/trunk/products/ERP5/interfaces/document.py [utf8] Fri May 28 18:21:22 2010
@@ -191,7 +191,9 @@
 
     format - the format specied in the form of an extension
     string (ex. jpeg, html, text, txt, etc.)
-    **kw can be various things - e.g. resolution
+    if format is None means that we do not want to change the format
+    and return the raw data or a resized image in same format.
+    **kw - can be various things - e.g. resolution
     """
 
   def isSupportBaseDataConversion():




More information about the Erp5-report mailing list