From d477630ccec0699a69f3b60d1a49610900c19001 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 10 Nov 2016 11:34:12 +0100 Subject: [PATCH] Updated documentation CURA-1263 --- plugins/3MFWriter/ThreeMFWorkspaceWriter.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py index 437b9188ae..afa3f53bf0 100644 --- a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py +++ b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py @@ -51,6 +51,9 @@ class ThreeMFWorkspaceWriter(WorkspaceWriter): mesh_writer.setStoreArchive(False) return True + ## Helper function that writes ContainerStacks, InstanceContainers and DefinitionContainers to the archive. + # \param container That follows the \type{ContainerInterface} to archive. + # \param archive The archive to write to. @staticmethod def _writeContainerToArchive(container, archive): if type(container) == type(ContainerRegistry.getInstance().getEmptyInstanceContainer()): @@ -66,9 +69,10 @@ class ThreeMFWorkspaceWriter(WorkspaceWriter): file_name = "Cura/%s.%s" % (container.getId(), file_suffix) if file_name in archive.namelist(): - return # File was already saved, no need to do it again. + return # File was already saved, no need to do it again. Uranium guarantees unique ID's, so this should hold. file_in_archive = zipfile.ZipInfo(file_name) + # For some reason we have to set the compress type of each file as well (it doesn't keep the type of the entire archive) file_in_archive.compress_type = zipfile.ZIP_DEFLATED archive.writestr(file_in_archive, container.serialize())