mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 16:28:59 +08:00
Updated documentation
CURA-1263
This commit is contained in:
parent
3ab283bfed
commit
d477630cce
@ -51,6 +51,9 @@ class ThreeMFWorkspaceWriter(WorkspaceWriter):
|
|||||||
mesh_writer.setStoreArchive(False)
|
mesh_writer.setStoreArchive(False)
|
||||||
return True
|
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
|
@staticmethod
|
||||||
def _writeContainerToArchive(container, archive):
|
def _writeContainerToArchive(container, archive):
|
||||||
if type(container) == type(ContainerRegistry.getInstance().getEmptyInstanceContainer()):
|
if type(container) == type(ContainerRegistry.getInstance().getEmptyInstanceContainer()):
|
||||||
@ -66,9 +69,10 @@ class ThreeMFWorkspaceWriter(WorkspaceWriter):
|
|||||||
file_name = "Cura/%s.%s" % (container.getId(), file_suffix)
|
file_name = "Cura/%s.%s" % (container.getId(), file_suffix)
|
||||||
|
|
||||||
if file_name in archive.namelist():
|
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)
|
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
|
file_in_archive.compress_type = zipfile.ZIP_DEFLATED
|
||||||
|
|
||||||
archive.writestr(file_in_archive, container.serialize())
|
archive.writestr(file_in_archive, container.serialize())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user