Merge branch 'split-removable-output-write-function' of https://github.com/zxc8027/Cura into zxc8027-split-removable-output-write-function

This commit is contained in:
Ghostkeeper 2022-06-15 14:37:39 +02:00
commit 20607b219a
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -80,6 +80,18 @@ class RemovableDriveOutputDevice(OutputDevice):
if extension: # Not empty string.
extension = "." + extension
file_name = os.path.join(self.getId(), file_name + extension)
self._performWrite(file_name, preferred_format, writer, nodes)
def _performWrite(self, file_name, preferred_format, writer, nodes):
"""Writes the specified nodes to the removable drive. This is split from
requestWrite to allow interception in other plugins. See Ultimaker/Cura#10917.
:param file_name: File path to write to.
:param preferred_format: Preferred file format to write to.
:param writer: Writer for writing to the file.
:param nodes: A collection of scene nodes that should be written to the
file.
"""
try:
Logger.log("d", "Writing to %s", file_name)