File disable-DeprecationWarnings-python311.patch of Package cura

diff -urN Cura-4.13.2/cura/UI/ObjectsModel.py Cura-4.13.2-patch/cura/UI/ObjectsModel.py
--- Cura-4.13.2/cura/UI/ObjectsModel.py	2022-06-01 15:27:49.000000000 +0300
+++ Cura-4.13.2-patch/cura/UI/ObjectsModel.py	2024-01-23 11:54:59.181289748 +0200
@@ -69,7 +69,7 @@
         self._group_name_template = catalog.i18nc("@label", "Group #{group_nr}")
         self._group_name_prefix = self._group_name_template.split("#")[0]
 
-        self._naming_regex = re.compile("^(.+)\(([0-9]+)\)$")
+        self._naming_regex = re.compile(r"^(.+)\(([0-9]+)\)$")
 
     def setActiveBuildPlate(self, nr: int) -> None:
         if self._build_plate_number != nr:
diff -urN Cura-4.13.2/plugins/3MFReader/ThreeMFReader.py Cura-4.13.2-patch/plugins/3MFReader/ThreeMFReader.py
--- Cura-4.13.2/plugins/3MFReader/ThreeMFReader.py	2022-06-01 15:27:49.000000000 +0300
+++ Cura-4.13.2-patch/plugins/3MFReader/ThreeMFReader.py	2024-01-23 10:23:19.548135627 +0200
@@ -123,7 +123,7 @@
         um_node.setTransformation(transformation)
         mesh_builder = MeshBuilder()
 
-        data = numpy.fromstring(savitar_node.getMeshData().getFlatVerticesAsBytes(), dtype=numpy.float32)
+        data = numpy.frombuffer(savitar_node.getMeshData().getFlatVerticesAsBytes(), dtype=numpy.float32)
 
         vertices = numpy.resize(data, (int(data.size / 3), 3))
         mesh_builder.setVertices(vertices)
@@ -304,4 +304,4 @@
             unit = "millimeter"
 
         scale = conversion_to_mm[unit]
-        return Vector(scale, scale, scale)
\ Ei rivinvaihtoa tiedoston lopussa
+        return Vector(scale, scale, scale)
diff -urN Cura-4.13.2/plugins/PostProcessingPlugin/Script.py Cura-4.13.2-patch/plugins/PostProcessingPlugin/Script.py
--- Cura-4.13.2/plugins/PostProcessingPlugin/Script.py	2022-06-01 15:27:49.000000000 +0300
+++ Cura-4.13.2-patch/plugins/PostProcessingPlugin/Script.py	2024-01-23 10:18:16.102572286 +0200
@@ -122,7 +122,7 @@
         if not key in line or (';' in line and line.find(key) > line.find(';')):
             return default
         sub_part = line[line.find(key) + 1:]
-        m = re.search('^-?[0-9]+\.?[0-9]*', sub_part)
+        m = re.search(r'^-?[0-9]+\.?[0-9]*', sub_part)
         if m is None:
             return default
         try:
diff -urN Cura-4.13.2/plugins/PostProcessingPlugin/scripts/ColorMix.py Cura-4.13.2-patch/plugins/PostProcessingPlugin/scripts/ColorMix.py
--- Cura-4.13.2/plugins/PostProcessingPlugin/scripts/ColorMix.py	2022-06-01 15:27:49.000000000 +0300
+++ Cura-4.13.2-patch/plugins/PostProcessingPlugin/scripts/ColorMix.py	2024-01-23 10:19:42.000813802 +0200
@@ -112,7 +112,7 @@
             m = re.search("^[+-]?[0-9]*", subPart)
         else:
             #the minus at the beginning allows for negative values, e.g. for delta printers
-            m = re.search("^[-]?[0-9]*\.?[0-9]*", subPart)
+            m = re.search(r"^[-]?[0-9]*\.?[0-9]*", subPart)
         if m == None:
             return default
         try:
@@ -205,4 +205,4 @@
                 lineIndex += 1  #for deleting index
             data[index] = modified_gcode
             index += 1
-        return data
\ Ei rivinvaihtoa tiedoston lopussa
+        return data
diff -urN Cura-4.13.2/plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py Cura-4.13.2-patch/plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py
--- Cura-4.13.2/plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py	2022-06-01 15:27:49.000000000 +0300
+++ Cura-4.13.2-patch/plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py	2024-01-23 10:05:54.462253548 +0200
@@ -20,9 +20,7 @@
     def __init__(self):
         super().__init__()
 
-        self._update_thread = threading.Thread(target = self._updateThread)
-        self._update_thread.setDaemon(True)
-
+        self._update_thread = threading.Thread(target = self._updateThread, daemon = True)
         self._check_updates = True
 
         self._drives = {}
diff -urN Cura-4.13.2/plugins/UM3NetworkPrinting/src/ExportFileJob.py Cura-4.13.2-patch/plugins/UM3NetworkPrinting/src/ExportFileJob.py
--- Cura-4.13.2/plugins/UM3NetworkPrinting/src/ExportFileJob.py	2022-06-01 15:27:49.000000000 +0300
+++ Cura-4.13.2-patch/plugins/UM3NetworkPrinting/src/ExportFileJob.py	2024-01-23 10:03:34.392983532 +0200
@@ -28,7 +28,7 @@
 
         # Determine the filename.
         job_name = CuraApplication.getInstance().getPrintInformation().jobName
-        job_name = re.sub("[^\w\-. ()]", "-", job_name)
+        job_name = re.sub(r"[^\w\-. ()]", "-", job_name)
         extension = self._mesh_format_handler.preferred_format.get("extension", "")
         self.setFileName("{}.{}".format(job_name, extension))
 
diff -urN Cura-4.13.2/plugins/USBPrinting/USBPrinterOutputDeviceManager.py Cura-4.13.2-patch/plugins/USBPrinting/USBPrinterOutputDeviceManager.py
--- Cura-4.13.2/plugins/USBPrinting/USBPrinterOutputDeviceManager.py	2022-06-01 15:27:49.000000000 +0300
+++ Cura-4.13.2-patch/plugins/USBPrinting/USBPrinterOutputDeviceManager.py	2024-01-23 11:38:26.753684217 +0200
@@ -38,8 +38,7 @@
         self._serial_port_list = []
         self._usb_output_devices = {}
         self._usb_output_devices_model = None
-        self._update_thread = threading.Thread(target = self._updateThread)
-        self._update_thread.setDaemon(True)
+        self._update_thread = threading.Thread(target = self._updateThread, daemon = True)
 
         self._check_updates = True
 
diff -urN Cura-4.13.2/plugins/USBPrinting/USBPrinterOutputDevice.py Cura-4.13.2-patch/plugins/USBPrinting/USBPrinterOutputDevice.py
--- Cura-4.13.2/plugins/USBPrinting/USBPrinterOutputDevice.py	2022-06-01 15:27:49.000000000 +0300
+++ Cura-4.13.2-patch/plugins/USBPrinting/USBPrinterOutputDevice.py	2024-01-23 12:47:24.167421206 +0200
@@ -277,8 +277,8 @@
                     self.sendCommand("M105")
                     self._last_temperature_request = time()
 
-            if re.search(b"[B|T\d*]: ?\d+\.?\d*", line):  # Temperature message. 'T:' for extruder and 'B:' for bed
-                extruder_temperature_matches = re.findall(b"T(\d*): ?(\d+\.?\d*)\s*\/?(\d+\.?\d*)?", line)
+            if re.search(r"[B|T\d*]: ?\d+\.?\d*", line):  # Temperature message. 'T:' for extruder and 'B:' for bed
+                extruder_temperature_matches = re.findall(r"T(\d*): ?(\d+\.?\d*)\s*\/?(\d+\.?\d*)?", line)
                 # Update all temperature values
                 matched_extruder_nrs = []
                 for match in extruder_temperature_matches:
@@ -300,7 +300,7 @@
                     if match[2]:
                         extruder.updateTargetHotendTemperature(float(match[2]))
 
-                bed_temperature_matches = re.findall(b"B: ?(\d+\.?\d*)\s*\/?(\d+\.?\d*)?", line)
+                bed_temperature_matches = re.findall(r"B: ?(\d+\.?\d*)\s*\/?(\d+\.?\d*)?", line)
                 if bed_temperature_matches:
                     match = bed_temperature_matches[0]
                     if match[0]:
openSUSE Build Service is sponsored by