[Erp5-report] r35336 nicolas - /erp5/trunk/products/ERP5OOo/transforms/

nobody at svn.erp5.org nobody at svn.erp5.org
Fri May 14 14:08:22 CEST 2010


Author: nicolas
Date: Fri May 14 14:08:20 2010
New Revision: 35336

URL: http://svn.erp5.org?rev=35336&view=rev
Log:
lxml is an hard dependency, so remove defensing code to workaround ImportError

Modified:
    erp5/trunk/products/ERP5OOo/transforms/oood_commandtransform.py

Modified: erp5/trunk/products/ERP5OOo/transforms/oood_commandtransform.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5OOo/transforms/oood_commandtransform.py?rev=35336&r1=35335&r2=35336&view=diff
==============================================================================
--- erp5/trunk/products/ERP5OOo/transforms/oood_commandtransform.py [utf8] (original)
+++ erp5/trunk/products/ERP5OOo/transforms/oood_commandtransform.py [utf8] Fri May 14 14:08:20 2010
@@ -9,14 +9,11 @@
 from OFS.Image import Image as OFSImage
 from zLOG import LOG
 
-try:
-  from Products.ERP5OOo.OOoUtils import OOoBuilder
-  import re
-  from lxml import etree
-  from lxml.etree import ParseError, Element
-  import_succeed = 1
-except ImportError:
-  import_succeed = 0
+from Products.ERP5OOo.OOoUtils import OOoBuilder
+import re
+from lxml import etree
+from lxml.etree import ParseError, Element
+
 from urllib import unquote
 from urlparse import urlparse
 try:
@@ -69,7 +66,7 @@
       self.__name__ = name
     self.mimetype = mimetype
     self.context = context
-    if import_succeed and self.mimetype == 'text/html':
+    if self.mimetype == 'text/html':
       data = self.includeExternalCssList(data)
     self.data = data
 
@@ -199,7 +196,7 @@
   def convertTo(self, format):
     if self.ooo.isTargetFormatAllowed(format):
       mime, data = self.ooo.convert(format)
-      if import_succeed and self.mimetype == 'text/html':
+      if self.mimetype == 'text/html':
         data = self.includeImageList(data)
       return data
     else:




More information about the Erp5-report mailing list