From 2a1a02ba98c808d74eca1d28184bd952967a6198 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Sun, 8 Feb 2026 20:15:18 -0600 Subject: [PATCH] Translate freecadweb to freecad in macro icon path (cherry picked from commit 5d676c6ad6c2fd47f8e2bf79d757ae5f20db5aa1) --- MacroCacheCreator.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MacroCacheCreator.py b/MacroCacheCreator.py index 477e0849..31e39c48 100644 --- a/MacroCacheCreator.py +++ b/MacroCacheCreator.py @@ -76,7 +76,10 @@ def fetch_macros(self): self.retrieve_macros_from_wiki() print("Downloading icons...") for macro in self.macros.values(): - self.get_icon(macro) + try: + self.get_icon(macro) + except RuntimeError as e: + self.macro_errors[macro.name] = str(e) self.macro_stats["errors"] = len(self.macro_errors) def create_cache(self) -> str: @@ -163,6 +166,8 @@ def get_icon(macro: Macro): """Downloads the macro's icon from whatever source is specified and stores its binary contents in self.icon_data""" if macro.icon.startswith("http://") or macro.icon.startswith("https://"): + if "freecadweb" in macro.icon: + macro.icon = macro.icon.replace("freecadweb", "freecad") parsed_url = urllib.parse.urlparse(macro.icon) try: p = requests.get(macro.icon, headers=headers, timeout=10.0)