[Erp5-report] r41817 nicolas - /erp5/trunk/products/ERP5/Document/

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Dec 28 10:07:41 CET 2010


Author: nicolas
Date: Tue Dec 28 10:07:41 2010
New Revision: 41817

URL: http://svn.erp5.org?rev=41817&view=rev
Log:
Get rid of getToolByName

Modified:
    erp5/trunk/products/ERP5/Document/File.py
    erp5/trunk/products/ERP5/Document/Image.py
    erp5/trunk/products/ERP5/Document/PDFDocument.py

Modified: erp5/trunk/products/ERP5/Document/File.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/File.py?rev=41817&r1=41816&r2=41817&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/File.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/File.py [utf8] Tue Dec 28 10:07:41 2010
@@ -34,7 +34,6 @@ from Products.ERP5.Document.Document imp
 from Products.ERP5.Document.Document import ConversionError
 from Products.ERP5Type.Base import Base, removeIContentishInterface
 from Products.CMFDefault.File import File as CMFFile
-from Products.CMFCore.utils import getToolByName
 from OFS.Image import Pdata
 import cStringIO
 from Products.ERP5Type.Utils import deprecated

Modified: erp5/trunk/products/ERP5/Document/Image.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Image.py?rev=41817&r1=41816&r2=41817&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Image.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Image.py [utf8] Tue Dec 28 10:07:41 2010
@@ -52,7 +52,6 @@ from zLOG import LOG, WARNING
 
 # import mixin
 from Products.ERP5.mixin.text_convertable import TextConvertableMixin
-from Products.CMFCore.utils import getToolByName
 
 def getDefaultImageQuality(portal, format=None):
   preference_tool = portal.portal_preferences
@@ -240,12 +239,12 @@ class Image(TextConvertableMixin, File, 
     """
     Convert the image to text with portaltransforms
     """
-    mime_type = getToolByName(self, 'mimetypes_registry').\
-                                lookupExtension('name.%s' % format)
+    portal = self.getPortalObject()
+    mime_type = portal.mimetypes_registry.lookupExtension('name.%s' % format)
     mime_type = str(mime_type)
     src_mimetype = self.getContentType()
     content = self.getData()
-    portal_transforms = getToolByName(self, 'portal_transforms')
+    portal_transforms = portal.portal_transforms
     result = portal_transforms.convertToData(mime_type, content,
                                              object=self, context=self,
                                              filename=self.getTitleOrId(),

Modified: erp5/trunk/products/ERP5/Document/PDFDocument.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/PDFDocument.py?rev=41817&r1=41816&r2=41817&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/PDFDocument.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/PDFDocument.py [utf8] Tue Dec 28 10:07:41 2010
@@ -29,8 +29,7 @@
 import tempfile, os
 
 from AccessControl import ClassSecurityInfo
-from Products.CMFCore.utils import getToolByName, _setCacheHeaders,\
-    _ViewEmulator
+from Products.CMFCore.utils import _setCacheHeaders, _ViewEmulator
 
 from Products.ERP5Type import Permissions, PropertySheet
 from Products.ERP5.Document.Image import Image



More information about the Erp5-report mailing list