Use virtual_path parameter instead of target

This parameter was renamed.

Contributes to issue CURA-4872.
This commit is contained in:
Ghostkeeper 2018-01-26 15:43:14 +01:00
parent d299786de7
commit b6c7a0829f
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A

View file

@ -20,11 +20,11 @@ class UFPWriter(MeshWriter):
PluginRegistry.getInstance().getPluginObject("GCodeWriter").write(gcode_textio, None) PluginRegistry.getInstance().getPluginObject("GCodeWriter").write(gcode_textio, None)
gcode = archive.getStream("/3D/model.gcode") gcode = archive.getStream("/3D/model.gcode")
gcode.write(gcode_textio.getvalue().encode("UTF-8")) gcode.write(gcode_textio.getvalue().encode("UTF-8"))
archive.addRelation(target = "/3D/model.gcode", file_type = "http://schemas.ultimaker.org/package/2018/relationships/gcode") archive.addRelation(virtual_path = "/3D/model.gcode", file_type = "http://schemas.ultimaker.org/package/2018/relationships/gcode")
#Store the thumbnail. #Store the thumbnail.
#TODO: Generate the thumbnail image. Below is just a placeholder. #TODO: Generate the thumbnail image. Below is just a placeholder.
archive.addContentType(extension = "png", mime_type = "image/png") archive.addContentType(extension = "png", mime_type = "image/png")
thumbnail = archive.getStream("/Metadata/thumbnail.png") thumbnail = archive.getStream("/Metadata/thumbnail.png")
thumbnail.write(os.path.join(os.path.basename(__file__), "kitten.png")) thumbnail.write(os.path.join(os.path.basename(__file__), "kitten.png"))
archive.addRelation(target = "/Metadata/thumbnail.png", file_type = "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail") archive.addRelation(virtual_path = "/Metadata/thumbnail.png", file_type = "http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail")