def depth_calculator(obj):
    """Determine how far in the hierarchy the file/folder is in. Works for either File or Folder class"""
    depth = 0
    dad = obj.parent_folder
    next_in = True

    while next_in:
        if dad.parent_folder:
            depth += 1
            dad = dad.parent_folder
        else:
            next_in = False

    return depth