def _stripGlyphXMLTree(nodes): for element, attrs, children in nodes: # "lib" is formatted as a plist, so we need unstripped # character data so we can support strings with leading or # trailing whitespace. Do strip everything else. recursive = (element != "lib") stripCharacterData(children, recursive=recursive)
def _glifTreeFromFile(aFile): try: tree = buildTree(aFile, stripData=False) stripCharacterData(tree[2], recursive=False) assert tree[0] == "glyph" _stripGlyphXMLTree(tree[2]) return tree except: print "Problem with glif file", aFile raise return None
def _glifTreeFromFile(aFile): tree = buildTree(aFile, stripData=False) stripCharacterData(tree[2], recursive=False) assert tree[0] == "glyph" _stripGlyphXMLTree(tree[2]) return tree