From a6668a687346bad6823be2d73fd0cbbc0777415a Mon Sep 17 00:00:00 2001 From: Suzanne Soy Date: Thu, 1 Jun 2023 21:40:12 +0100 Subject: [PATCH] Depend on lxml, and display a warning if it cannot be found. --- ResultsPreferences.py | 7 ++++++- package.xml | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ResultsPreferences.py b/ResultsPreferences.py index 5dffa8f..4b1eaed 100644 --- a/ResultsPreferences.py +++ b/ResultsPreferences.py @@ -46,7 +46,12 @@ def getParamGroups(nameInConfig, nameInPath): return recur(True, nameInPath, nameInPath, root) def getAllParams(): - return [getParamGroups('UserParameter', 'User parameter')] + try: + from lxml import etree + return [getParamGroups('UserParameter', 'User parameter')] + except: + print('Could not load the list of all parameters. Please install the LXML python library with:\npython -m pip install --upgrade lxml') + return [] def paramGroupAction(nfo): FreeCADGui.runCommand('Std_DlgParameter',0) diff --git a/package.xml b/package.xml index a011c59..3e62868 100644 --- a/package.xml +++ b/package.xml @@ -11,6 +11,7 @@ https://github.com/SuzanneSoy/SearchBar/issues https://github.com/SuzanneSoy/SearchBar Tango-System-search.svg + lxml SearchBar