def _read_blob_in_tree(tree, components):
    """Recursively open trees to ultimately read a blob"""
    if len(components) == 1:
        # Tree is direct parent of blob
        return _read_blob(tree, components[0])
    else:
        # Still trees to open
        dirname = components.pop(0)
        for t in tree.traverse():
            if t.name == dirname:
                return _read_blob_in_tree(t, components)
def _read_blob_in_tree ( tree , components ) : if len ( components ) == 1 : return _read_blob ( tree , components [ 0 ] ) else : dirname = components . pop ( 0 ) for t in tree . traverse ( ) : if t . name == dirname : return _read_blob_in_tree ( t , components )
Recursively open trees to ultimately read a blob