Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime van Kessel <nallath@gmail.com>2020-01-14 17:40:38 +0300
committerJaime van Kessel <nallath@gmail.com>2020-01-14 17:40:38 +0300
commit6ae3172287a20cd2e54b22a95997aa10c7bfe29a (patch)
treeb5eebef110058e6738a7d5ad5dcfecce0ca61b01 /plugins/3MFWriter
parentb6d1429eb779b4724ea186d7d9eaee75e99054c3 (diff)
Store metadata when writing the workspace
Diffstat (limited to 'plugins/3MFWriter')
-rw-r--r--plugins/3MFWriter/ThreeMFWorkspaceWriter.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py
index 33df0bfe90..953b0a57e6 100644
--- a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py
+++ b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py
@@ -73,11 +73,22 @@ class ThreeMFWorkspaceWriter(WorkspaceWriter):
version_config_parser.write(version_file_string)
archive.writestr(version_file, version_file_string.getvalue())
+ self._writePluginMetadataToArchive(archive)
+
# Close the archive & reset states.
archive.close()
mesh_writer.setStoreArchive(False)
return True
+ def _writePluginMetadataToArchive(self, archive):
+ file_name = "Cura/plugin_metadata.json"
+
+ 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
+ import json
+ archive.writestr(file_in_archive, json.dumps(Application.getInstance()._workspace_metadata_storage.getAllData()))
+
## 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.