Fixed review issues

CURA-2108
This commit is contained in:
Jaime van Kessel 2016-09-01 16:43:40 +02:00
parent 8dc1011b67
commit 697329f5d2

View file

@ -275,7 +275,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
# The XML material profile can have specific settings for machines.
# Some machines share profiles, so they are only created once.
# This function duplicates those elements so that each machine tag only has one identifier.
def _flattenMachinesXML(self, element):
def _expandMachinesXML(self, element):
settings_element = element.find("./um:settings", self.__namespaces)
machines = settings_element.iterfind("./um:machine", self.__namespaces)
machines_to_add = []
@ -309,7 +309,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
def _mergeXML(self, first, second):
result = copy.deepcopy(first)
self._combineElement(self._flattenMachinesXML(result), self._flattenMachinesXML(second))
self._combineElement(self._expandMachinesXML(result), self._expandMachinesXML(second))
return result
def _createKey(self, element):
@ -339,7 +339,7 @@ class XmlMaterialProfile(UM.Settings.InstanceContainer):
key = self._createKey(element)
if len(element): # Check if element has children.
try:
if "setting " in key:
if "setting" in element.tag and not "settings" in element.tag:
# Setting can have points in it. In that case, delete all values and override them.
for child in list(mapping[key]):
mapping[key].remove(child)