If you manage to distil the issue to a minimal sample, I might be able to take a look; what you've posted so far is a little too much to digest.
On 2 April 2015 at 10:09, Benjam901 <[email protected]> wrote: > OOh something weird happened with the gist the actual code without >> duplicates is below: >> > > def gatherXMLElementInfo(treeViewItems, root): > # Iterate backwards through the object list > for item in reversed(treeViewItems): > # If the current item is the last item in the list > if item == treeViewItems[0]: > # We need to iterate through the parent element > children i.e. the list that our element is hiding in > if not item in self.elemsToIgnore: > if root.getchildren(): > for elem in root.getchildren(): > elemAttributes = elem.attrib > correctElement = > [elemAttributes.get(i) for i in elemAttributes if elemAttributes.get(i) == > item] > if correctElement: > print correctElement[0] > break > return > else: > return > else: > if item in self.elemsToIgnore: > print "IGNORE", item > xmlElem = root.findall(item)[0] > else: > for child in root.getchildren(): > #print child, root > elemAttributes = child.attrib > correctElement = [elemAttributes.get(i) > for i in elemAttributes if elemAttributes.get(i) == item] > if correctElement: > print "FOUNDDDDDD IT", child > xmlElem = child > break > listMinusOne = [i for i in treeViewItems if not i == > item] > print " XML ELm", xmlElem > > gatherXMLElementInfo(listMinusOne, xmlElem) > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/35125785-078f-498b-b796-19566479da4d%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/35125785-078f-498b-b796-19566479da4d%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- *Marcus Ottosson* [email protected] -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAiNC3%2BLr_Ghf2XM1T0Htx6bmwSPkb2urvw4kExLhQ2zQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
