def find_rootname(node):
    rootname = rootname_from_archive_olpath(node)
    if not rootname:
        n = node
        p = node.parent
        while not p.is_root():
            n = p
            p = p.parent
        # n is root node
        rootname = rootname_from_archive_olpath(n) or n.heading
    return rootname
Find rootname given node
dataset/ETHPy150Open tkf/orgviz/orgviz/dones.py/find_rootname