Exemplo n.º 1
0
    # list impact function
    for ui in list_unique_identifier:
        content_rst += '   ' + impact_func_doc_dir + os.sep + \
                       ui.replace(' ', '') + '\n'

    create_rst_file(insafe_dir_path + os.sep + doc_dir, 'impact_functions_doc',
                    content_rst)


if __name__ == "__main__":
    # remove old files, in case you disabled or remove impact function
    impact_func_doc_dir_path = (insafe_dir_path + os.sep + doc_dir + os.sep +
                                impact_func_doc_dir)
    if os.path.exists(impact_func_doc_dir_path):
        rmtree(impact_func_doc_dir_path)

    impfunc_doc = {}
    # Get all impact functions
    plugins_dict = get_plugins()
    for myKey, myFunc in plugins_dict.iteritems():
        if not is_function_enabled(myFunc):
            continue
        impfunc_doc[myKey] = get_documentation(myKey)
    list_unique_identifier = [
        x['unique_identifier'] for x in impfunc_doc.itervalues()
    ]
    gen_impact_func_index(list_unique_identifier)

    create_dirs(impact_func_doc_dir_path)
    gen_rst_doc(impfunc_doc)
        inasafe_doc_path = None

    # remove old files, in case you disabled or remove impact function
    documentation_path = (
        os.path.join(
            get_inasafe_documentation_path(
                inasafe_doc_path), doc_dir, impact_func_doc_dir))

    if os.path.exists(documentation_path):
        rmtree(documentation_path)

    metadata = {}
    doc_strings = {}
    # Get all impact functions
    plugins_dict = get_plugins()
    for key, impact_function in plugins_dict.iteritems():
        if not is_function_enabled(impact_function):
            continue
        metadata[key] = get_metadata(key)
        doc_strings[key] = get_doc_string(impact_function)
    function_ids = [x['unique_identifier'] for x in metadata.values()]
    print 'Generating index page for Impact Functions Documentation'
    create_index(function_ids)

    create_dirs(documentation_path)

    print 'Generating page for Impact Functions'
    generate_documentation(metadata, doc_strings)

    print 'Fin.'
    write_rst_file(
        index_path,
        'impact_functions_doc',
        content_rst)


if __name__ == "__main__":
    # remove old files, in case you disabled or remove impact function
    documentation_path = (
        os.path.join(get_inasafe_documentation_path(), doc_dir,
                     impact_func_doc_dir))

    if os.path.exists(documentation_path):
        rmtree(documentation_path)

    metadata = {}
    doc_strings = {}
    # Get all impact functions
    plugins_dict = get_plugins()
    for myKey, myFunc in plugins_dict.iteritems():
        if not is_function_enabled(myFunc):
            continue
        metadata[myKey] = get_metadata(myKey)
        doc_strings[myKey] = get_doc_string(myFunc)
    function_ids = [x['unique_identifier']
                    for x in metadata.values()]
    create_index(function_ids)

    create_dirs(documentation_path)
    generate_documentation(metadata, doc_strings)
Exemplo n.º 4
0
    else:
        inasafe_doc_path = None

    # remove old files, in case you disabled or remove impact function
    documentation_path = (os.path.join(
        get_inasafe_documentation_path(inasafe_doc_path), doc_dir,
        impact_func_doc_dir))

    if os.path.exists(documentation_path):
        rmtree(documentation_path)

    metadata = {}
    doc_strings = {}
    # Get all impact functions
    plugins_dict = get_plugins()
    for key, impact_function in plugins_dict.iteritems():
        if not is_function_enabled(impact_function):
            continue
        metadata[key] = get_metadata(key)
        doc_strings[key] = get_doc_string(impact_function)
    function_ids = [x['unique_identifier'] for x in metadata.values()]
    print 'Generating index page for Impact Functions Documentation'
    create_index(function_ids)

    create_dirs(documentation_path)

    print 'Generating page for Impact Functions'
    generate_documentation(metadata, doc_strings)

    print 'Fin.'