From 48fc9576953c59647b488734dfdc7a5b7c8f012b Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 21 Sep 2016 09:45:05 +0200 Subject: [PATCH] We now throw an exception when trying to read legacy profile when multi extrusion machine is selected CURA-2421 --- plugins/LegacyProfileReader/LegacyProfileReader.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/LegacyProfileReader/LegacyProfileReader.py b/plugins/LegacyProfileReader/LegacyProfileReader.py index 26f50f22bd..5105bf71da 100644 --- a/plugins/LegacyProfileReader/LegacyProfileReader.py +++ b/plugins/LegacyProfileReader/LegacyProfileReader.py @@ -67,12 +67,13 @@ class LegacyProfileReader(ProfileReader): if file_name.split(".")[-1] != "ini": return None - multi_extrusion = Application.getInstance().getGlobalContainerStack().getProperty("machine_extruder_count","value") > 1 + multi_extrusion = Application.getInstance().getGlobalContainerStack().getProperty("machine_extruder_count", "value") > 1 if multi_extrusion: - Logger.log("e", "Unable to create legacy profile %s. Multi extrusion is not supported", file_name) - return None + Logger.log("e", "Unable to import legacy profile %s. Multi extrusion is not supported", file_name) + raise Exception("Unable to import legacy profile. Multi extrusion is not supported") + Logger.log("i", "Importing legacy profile from file " + file_name + ".") - profile = InstanceContainer("Imported Legacy Profile") #Create an empty profile. + profile = InstanceContainer("Imported Legacy Profile") # Create an empty profile. parser = configparser.ConfigParser(interpolation = None) try: