comparison libervia/backend/plugins/plugin_misc_text_syntaxes.py @ 4325:45662662a432

plugin text syntaxes: update exception message to be more explicit when `lxml_html_clean` is missing.
author Goffi <goffi@goffi.org>
date Wed, 20 Nov 2024 11:30:43 +0100
parents 0d7bb4df2343
children 111dce64dcb5
comparison
equal deleted inserted replaced
4324:e1fcf4dd9012 4325:45662662a432
31 from libervia.backend.core.log import getLogger 31 from libervia.backend.core.log import getLogger
32 from libervia.backend.tools import xml_tools 32 from libervia.backend.tools import xml_tools
33 33
34 try: 34 try:
35 from lxml import html 35 from lxml import html
36 from lxml.html import clean
37 from lxml import etree 36 from lxml import etree
38 except ImportError: 37 except ImportError:
39 raise exceptions.MissingModule( 38 raise exceptions.MissingModule(
40 "Missing module lxml, please download/install it from http://lxml.de/" 39 'Missing module "lxml", please download/install it from http://lxml.de/'
40 )
41 try:
42 from lxml.html import clean
43 except ImportError:
44 raise exceptions.MissingModule(
45 'Missing module "lxml_html_clean". Please download and install it from '
46 'http://lxml.de/. Note that this is a separate package to install in addition '
47 'to "lxml".'
41 ) 48 )
42 49
43 log = getLogger(__name__) 50 log = getLogger(__name__)
44 51
45 CATEGORY = D_("Composition") 52 CATEGORY = D_("Composition")