def create_vdir(names=[]):
    if not confirm("Do you want to create a local calendar? (You can always "
                   "set it up to synchronize with a server in vdirsyncer "
                   "later)."):
        return None
    name = 'private'
    while True:
        path = join(xdg.BaseDirectory.xdg_data_home, 'khal', 'calendars', name)
        path = normpath(expanduser(expandvars(path)))
        if name not in names and not exists(path):
            break
        else:
            name += '1'
    try:
        dirpath = split(path)[0]
        if not exists(dirpath) and not isdir(dirpath):
            makedirs(dirpath)
    except OSError as error:
        print("Could not create directory {} because of {}".format(dirpath, error))
        return None
    else:
        return [(name, path, 'calendar')]
dataset/ETHPy150Open pimutils/khal/khal/configwizard.py/create_vdir/original