changeset 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 (5 weeks ago)
parents e1fcf4dd9012
children 5fd6a4dc2122
files libervia/backend/plugins/plugin_misc_text_syntaxes.py
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libervia/backend/plugins/plugin_misc_text_syntaxes.py	Wed Nov 20 11:29:36 2024 +0100
+++ b/libervia/backend/plugins/plugin_misc_text_syntaxes.py	Wed Nov 20 11:30:43 2024 +0100
@@ -33,11 +33,18 @@
 
 try:
     from lxml import html
-    from lxml.html import clean
     from lxml import etree
 except ImportError:
     raise exceptions.MissingModule(
-        "Missing module lxml, please download/install it from http://lxml.de/"
+        'Missing module "lxml", please download/install it from http://lxml.de/'
+    )
+try:
+    from lxml.html import clean
+except ImportError:
+    raise exceptions.MissingModule(
+        'Missing module "lxml_html_clean". Please download and install it from '
+        'http://lxml.de/. Note that this is a separate package to install in addition '
+        'to "lxml".'
     )
 
 log = getLogger(__name__)