From b660885a587a2afb642c26d94dc7dce3aa7ba2f6 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Wed, 13 Nov 2024 09:28:55 +0100 Subject: [PATCH 1/3] Fix 'AttributeError' (defensive coding). should fix sentry#CURA-1D2 --- cura/Settings/MachineManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 851e8528009..82b52d3dde5 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -398,7 +398,7 @@ def _validateVariantsAndMaterials(self, global_stack) -> None: self.setVariantByName(extruder.getMetaDataEntry("position"), machine_node.preferred_variant_name) variant_node = machine_node.variants.get(machine_node.preferred_variant_name) - material_node = variant_node.materials.get(extruder.material.getMetaDataEntry("base_file")) + material_node = variant_node.materials.get(extruder.material.getMetaDataEntry("base_file")) if variant_node else None if material_node is None: Logger.log("w", "An extruder has an unknown material, switching it to the preferred material") if not self.setMaterialById(extruder.getMetaDataEntry("position"), machine_node.preferred_material): From f0a720526732d0dc1c4eacbdab1facbdf893c31c Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Wed, 13 Nov 2024 09:29:53 +0100 Subject: [PATCH 2/3] Fix 'OverflowError' (defensive coding). should fix sentry#CURA-1EB --- cura/UI/CuraSplashScreen.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cura/UI/CuraSplashScreen.py b/cura/UI/CuraSplashScreen.py index 331fb2e880f..a61c13a19b1 100644 --- a/cura/UI/CuraSplashScreen.py +++ b/cura/UI/CuraSplashScreen.py @@ -1,5 +1,6 @@ # Copyright (c) 2020 Ultimaker B.V. # Uranium is released under the terms of the LGPLv3 or higher. +import math from PyQt6.QtCore import Qt, QCoreApplication, QTimer from PyQt6.QtGui import QPixmap, QColor, QFont, QPen, QPainter @@ -51,6 +52,7 @@ def updateLoadingImage(self): self._last_update_time = time.time() # Since we don't know how much time actually passed, check how many intervals of 50 we had. self._loading_image_rotation_angle -= 10 * (time_since_last_update * 1000 / 50) + self._loading_image_rotation_angle = math.fmod(self._loading_image_rotation_angle, 360) self.repaint() # Override the mousePressEvent so the splashscreen doesn't disappear when clicked From 1c6e14eb7d15ccc74aae1d4404e45ee965537eb6 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Wed, 13 Nov 2024 09:31:02 +0100 Subject: [PATCH 3/3] Attempt to fix 'FileNotFoundError' (defensive coding). hopefully fixes sentry#CURA-3JS --- cura/UI/WelcomePagesModel.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cura/UI/WelcomePagesModel.py b/cura/UI/WelcomePagesModel.py index 5faf39311e3..833f34e269b 100644 --- a/cura/UI/WelcomePagesModel.py +++ b/cura/UI/WelcomePagesModel.py @@ -217,8 +217,7 @@ def getPageIndexById(self, page_id: str) -> Optional[int]: def _getBuiltinWelcomePagePath(page_filename: str) -> QUrl: """Convenience function to get QUrl path to pages that's located in "resources/qml/WelcomePages".""" from cura.CuraApplication import CuraApplication - return QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles, - os.path.join("WelcomePages", page_filename))) + return QUrl.fromLocalFile(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles, "WelcomePages", page_filename)) # FIXME: HACKs for optimization that we don't update the model every time the active machine gets changed. def _onActiveMachineChanged(self) -> None: