From 112dd97adf2837dcc340e94dbbc22e5c7a8f22c3 Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Thu, 18 Apr 2024 20:47:21 -0700 Subject: [PATCH] gui: toolboxes2menudata skips uncompiled modules (#3628) --- gui/wxpython/core/toolboxes.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gui/wxpython/core/toolboxes.py b/gui/wxpython/core/toolboxes.py index b693293bef2..8c8c380295c 100644 --- a/gui/wxpython/core/toolboxes.py +++ b/gui/wxpython/core/toolboxes.py @@ -15,6 +15,7 @@ import os import sys import copy +import shutil import xml.etree.ElementTree as etree from xml.parsers import expat @@ -591,15 +592,19 @@ def _expandRuntimeModules(node, loadMetadata=True): if module.find("description") is None: if loadMetadata: - desc, keywords = _loadMetadata(name) + # not all modules are always compiled (e.g., r.in.lidar) + if shutil.which(name): + desc, keywords = _loadMetadata(name) + if not desc: + hasErrors = True + else: + desc, keywords = _("Module not installed"), "" else: desc, keywords = "", "" n = etree.SubElement(module, "description") n.text = _escapeXML(desc) n = etree.SubElement(module, "keywords") n.text = _escapeXML(",".join(keywords)) - if loadMetadata and not desc: - hasErrors = True if hasErrors: # not translatable until toolboxes compilation on Mac is fixed