From 0e2d35a88d389f5a523a2ba001f49b1cdee45d80 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Fri, 26 Aug 2016 17:02:21 +0200 Subject: [PATCH] Use parseBool instead of inline variation CURA-2138 --- plugins/XmlMaterialProfile/XmlMaterialProfile.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index 6f683a458d..b027c99c5e 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -8,6 +8,7 @@ import xml.etree.ElementTree as ET import uuid from UM.Logger import Logger +from UM.Util import parseBool import UM.Dictionary @@ -300,7 +301,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer): global_setting_values[self.__material_property_setting_map[key]] = entry.text elif key in self.__unmapped_settings: if key == "hardware compatible": - global_compatibility = entry.text.lower() not in ["no", "false", "0"] + global_compatibility = parseBool(entry.text) else: Logger.log("d", "Unsupported material setting %s", key) @@ -317,7 +318,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer): machine_setting_values[self.__material_property_setting_map[key]] = entry.text elif key in self.__unmapped_settings: if key == "hardware compatible": - machine_compatibility = entry.text.lower() not in ["no", "false", "0"] + machine_compatibility = parseBool(entry.text) else: Logger.log("d", "Unsupported material setting %s", key) @@ -376,7 +377,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer): hotend_setting_values[self.__material_property_setting_map[key]] = entry.text elif key in self.__unmapped_settings: if key == "hardware compatible": - hotend_compatibility = entry.text.lower() not in ["no", "false", "0"] + hotend_compatibility = parseBool(entry.text) else: Logger.log("d", "Unsupported material setting %s", key)