Breaks a path to a directory into a (drive, list-of-folders) tuple

    :param directory:
    :return: a tuple consisting of the drive (if any) and an ordered list of
             folder names

def get_path_components(directory):
    """Breaks a path to a directory into a (drive, list-of-folders) tuple

    :param directory:
    :return: a tuple consisting of the drive (if any) and an ordered list of
             folder names
    """
    drive, dirs = os.path.splitdrive(directory)
    folders = []
    previous = ""
    while dirs != previous and dirs != "":
        previous = dirs
        dirs, folder = os.path.split(dirs)
        if folder != "":
            folders.append(folder)
    folders.reverse()
    return drive, folders