mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Updated documentation
CURA-1263
This commit is contained in:
parent
3ab283bfed
commit
d477630cce
1 changed files with 5 additions and 1 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue