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)
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.'
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.'
content_rst += ' ' + impact_func_doc_dir + os.sep + \ ui.replace(' ', '') + '\n' write_rst_file(os.path.join(insafe_dir_path, 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 = (os.path.join(insafe_dir_path, doc_dir, impact_func_doc_dir)) if os.path.exists(impact_func_doc_dir_path): rmtree(impact_func_doc_dir_path) impfunc_doc = {} impfunc_doc_str = {} # 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) impfunc_doc_str[myKey] = get_doc_string(myFunc) list_unique_identifier = [x['unique_identifier'] for x in impfunc_doc.values()] gen_impact_func_index(list_unique_identifier) create_dirs(impact_func_doc_dir_path) gen_rst_doc(impfunc_doc, impfunc_doc_str)
content_rst += ( ' %s%s%s\n' % (impact_func_doc_dir, os.sep, identifier.replace(' ', ''))) index_path = os.path.join(get_inasafe_documentation_path(), doc_dir) 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)