Get the file formats directly from the stack

Instead of finding the container that contains the entry first and then getting the metadata from there.

Contributes to issue CURA-5097.
This commit is contained in:
Ghostkeeper 2018-03-19 14:21:41 +01:00
parent 7a464a92ca
commit c9a23d5ca3
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A

View file

@ -94,8 +94,8 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice):
file_formats = Application.getInstance().getMeshFileHandler().getSupportedFileTypesWrite()
#Create a list from the supported file formats string.
container = Application.getInstance().getGlobalContainerStack().findContainer({"file_formats": "*"})
machine_file_formats = [file_type.strip() for file_type in container.getMetaDataEntry("file_formats").split(";")]
machine_file_formats = Application.getInstance().getGlobalContainerStack().getMetaDataEntry("file_formats").split(";")
machine_file_formats = [file_type.strip() for file_type in machine_file_formats]
# Take the intersection between file_formats and machine_file_formats.
format_by_mimetype = {format["mime_type"]: format for format in file_formats}