mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 01:37:51 -06:00
Store the data from each plugin in it's own folder
CURA-6627
This commit is contained in:
parent
6ae3172287
commit
b8dbc1d160
1 changed files with 8 additions and 6 deletions
|
@ -81,13 +81,15 @@ class ThreeMFWorkspaceWriter(WorkspaceWriter):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _writePluginMetadataToArchive(self, archive):
|
def _writePluginMetadataToArchive(self, archive):
|
||||||
file_name = "Cura/plugin_metadata.json"
|
file_name_template = "%s/plugin_metadata.json"
|
||||||
|
|
||||||
|
for plugin_id, metadata in Application.getInstance()._workspace_metadata_storage.getAllData().items():
|
||||||
|
file_name = file_name_template % plugin_id
|
||||||
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)
|
# 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
|
||||||
import json
|
import json
|
||||||
archive.writestr(file_in_archive, json.dumps(Application.getInstance()._workspace_metadata_storage.getAllData()))
|
archive.writestr(file_in_archive, json.dumps(metadata, separators = (", ", ": "), indent = 4))
|
||||||
|
|
||||||
## Helper function that writes ContainerStacks, InstanceContainers and DefinitionContainers to the archive.
|
## Helper function that writes ContainerStacks, InstanceContainers and DefinitionContainers to the archive.
|
||||||
# \param container That follows the \type{ContainerInterface} to archive.
|
# \param container That follows the \type{ContainerInterface} to archive.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue