-
Notifications
You must be signed in to change notification settings - Fork 18
Translate freecadweb to freecad in macro icon path #336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -80,7 +80,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_errors[macro.name] = str(e) | |
| self.macro_errors[macro.name] = str(e) | |
| # Ensure macro icon fields are consistent with other error paths in get_icon | |
| macro.icon = None | |
| macro.icon_data = None |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes introduce new behaviors that aren’t covered by the existing TestMacroCatalog suite (1) continuing fetch_macros() when get_icon() raises, and (2) translating freecadweb→freecad in icon URLs. Adding a unit test that mocks requests.get / MacroCatalog.get_icon would help prevent regressions (e.g., ensuring other macros still get processed and the translated URL is requested).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new RuntimeError handler can overwrite a more specific existing entry for this macro in
self.macro_errors(e.g., ifget_iconalready recorded a message before raising). Consider only setting this key when it’s not already present, or preserving/combining the existing message so the root cause isn’t lost.