Merge pull request #20660 from Ultimaker/Update-PurgeAndUnload.py

Update PurgeLinesAndUnload.py
This commit is contained in:
Erwan MATHIEU 2025-06-16 10:52:14 +02:00 committed by GitHub
commit 985591fef8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -35,8 +35,9 @@ class Position(tuple, Enum):
class PurgeLinesAndUnload(Script):
def __init__(self):
super().__init__()
def initialize(self) -> None:
super().initialize()
# Get required values from the global stack and set default values for the script
self.global_stack = Application.getInstance().getGlobalContainerStack()
self.extruder = self.global_stack.extruderList
self.end_purge_location = None
@ -56,9 +57,6 @@ class PurgeLinesAndUnload(Script):
self.machine_back = self.machine_depth - 1.0
self.start_x = None
self.start_y = None
def initialize(self) -> None:
super().initialize()
# Get the StartUp Gcode from Cura and attempt to catch if it contains purge lines. Message the user if an extrusion is in the startup.
startup_gcode = self.global_stack.getProperty("machine_start_gcode", "value")
start_lines = startup_gcode.splitlines()