'Return the ancestor path of a node
@param node_id: the node ID
@param category: start with this category rather than with root
@param classify: return each node as tuple (id, category) instead
of just ids
@return: the path as list, starting at the root node'

def path(self, node_id, category=DEFAULT, classify=False):

    nodes = self.nodes
    node = nodes.get(node_id)
    if (not node):
        return []
    this = ((node_id, node['c']) if classify else node_id)
    if ((category is not DEFAULT) and (node['c'] == category)):
        return [this]
    parent_id = node['p']
    if (not parent_id):
        return [this]
    path = self.path(parent_id, category=category, classify=classify)
    path.append(this)
    return path
