mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 07:59:13 +08:00
Update 3MFWorkspaceReader to handle the new format of ContainerStack
Contributes to CURA-3098
This commit is contained in:
parent
0d023a196e
commit
3449108d59
@ -447,9 +447,17 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
def _getContainerIdListFromSerialized(self, serialized):
|
||||
parser = configparser.ConfigParser(interpolation=None, empty_lines_in_values=False)
|
||||
parser.read_string(serialized)
|
||||
container_string = parser["general"].get("containers", "")
|
||||
container_list = container_string.split(",")
|
||||
return [container_id for container_id in container_list if container_id != ""]
|
||||
|
||||
container_ids = []
|
||||
if "containers" in parser:
|
||||
for index, container_id in parser.items("containers"):
|
||||
container_ids.append(container_id)
|
||||
elif parser.has_option("general", "containers"):
|
||||
container_string = parser["general"].get("containers", "")
|
||||
container_list = container_string.split(",")
|
||||
container_ids = [container_id for container_id in container_list if container_id != ""]
|
||||
|
||||
return container_ids
|
||||
|
||||
def _getMachineNameFromSerializedStack(self, serialized):
|
||||
parser = configparser.ConfigParser(interpolation=None, empty_lines_in_values=False)
|
||||
@ -461,4 +469,5 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||
metadata = data.iterfind("./um:metadata/um:name/um:label", {"um": "http://www.ultimaker.com/material"})
|
||||
for entry in metadata:
|
||||
return entry.text
|
||||
pass
|
||||
pass
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user