Commit 278b4a32 authored by Nicolas Delaby's avatar Nicolas Delaby

lxml is an hard dependency, so remove defensing code to workaround ImportError

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35336 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 50d60642
...@@ -9,14 +9,11 @@ from zope.interface import implements ...@@ -9,14 +9,11 @@ from zope.interface import implements
from OFS.Image import Image as OFSImage from OFS.Image import Image as OFSImage
from zLOG import LOG from zLOG import LOG
try: from Products.ERP5OOo.OOoUtils import OOoBuilder
from Products.ERP5OOo.OOoUtils import OOoBuilder import re
import re from lxml import etree
from lxml import etree from lxml.etree import ParseError, Element
from lxml.etree import ParseError, Element
import_succeed = 1
except ImportError:
import_succeed = 0
from urllib import unquote from urllib import unquote
from urlparse import urlparse from urlparse import urlparse
try: try:
...@@ -69,7 +66,7 @@ class OOOdCommandTransform(commandtransform): ...@@ -69,7 +66,7 @@ class OOOdCommandTransform(commandtransform):
self.__name__ = name self.__name__ = name
self.mimetype = mimetype self.mimetype = mimetype
self.context = context self.context = context
if import_succeed and self.mimetype == 'text/html': if self.mimetype == 'text/html':
data = self.includeExternalCssList(data) data = self.includeExternalCssList(data)
self.data = data self.data = data
...@@ -199,7 +196,7 @@ class OOOdCommandTransform(commandtransform): ...@@ -199,7 +196,7 @@ class OOOdCommandTransform(commandtransform):
def convertTo(self, format): def convertTo(self, format):
if self.ooo.isTargetFormatAllowed(format): if self.ooo.isTargetFormatAllowed(format):
mime, data = self.ooo.convert(format) mime, data = self.ooo.convert(format)
if import_succeed and self.mimetype == 'text/html': if self.mimetype == 'text/html':
data = self.includeImageList(data) data = self.includeImageList(data)
return data return data
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment