Exemplo n.º 1
0
def run(mode, *fnames):  # pragma: no cover
    configure_logging()

    if mode == 'geo':
        return load_regions(fnames[0])
    if mode == 'tree':
        return load_trees(fnames[0])
    if mode == 'xd_lang':
        return xd_to_language(csv_dict_reader(fnames[0]), csv_dict_reader(fnames[1]))
    if mode in ITEM_LOADER:
        return ITEM_LOADER[mode](chain(*map(csv_dict_reader, fnames)))
    raise ValueError(mode)
Exemplo n.º 2
0
def csv_items(*names):
    return chain(*[csv_dict_reader(csv_path(name)) for name in names])