def push_files(results_set_name, path_list, publish_config,
               generate_indexes=True):
    """ Push a log file/foler to a server. Returns the public URL """

    file_list = []
    root_list = []

    for file_path in path_list:
        file_path = os.path.normpath(file_path)
        if os.path.isfile(file_path):
            root_list.append(os.path.basename(file_path))
        else:
            root_list.append(os.path.basename(file_path) + '/')

        file_list += build_file_list(
            file_path, publish_config['prepend_url'], results_set_name,
            generate_indexes
        )

    index_file = ''
    if generate_indexes:
        index_file = make_index_file(root_list, publish_config['prepend_url'],
                                     results_set_name)
        file_list.append({
            'filename': os.path.basename(index_file),
            'path': index_file})

    method = publish_config['type'] + '_push_files'
    if method in globals() and hasattr(globals()[method], '__call__'):
        globals()[method](results_set_name, file_list, publish_config)

    return os.path.join(publish_config['prepend_url'], results_set_name,
                        os.path.basename(index_file))
dataset/ETHPy150Open openstack/turbo-hipster/turbo_hipster/lib/utils.py/push_files/original