示例#1
0
def load_potisions(mode, config):

    [section_in, section_out] = tools.get_section(mode)
    header = tools.config_getboolean(config, section_in, "header")
    
    must = {}
    opts = {}
    for option in config.options(section_in):
        param = ""
        if option.find("col_") == 0:
            param = option.replace("col_", "")
        
        if len(param) > 0:
            if param.find("opt_") == 0:
                if header == True:
                    opts[param.replace("opt_", "")] = config.get(section_in, option)
                else:
                    opts[param.replace("opt_", "")] = config.getint(section_in, option)
            else:
                if header == True:
                    must[param] = config.get(section_in, option)
                else:
                    must[param] = config.getint(section_in, option)
                
    return {"must": must, "option": opts}
示例#2
0
def merge_result(files, ids, output_file, mode, config, extract = False):

    [section_in, section_out] = tools.get_section(mode)
    
    if tools.config_getboolean(config, section_in, "header") == True:
        return with_header(files, ids, output_file, mode, config, extract)
    else:
        return with_noheader(files, ids, output_file, mode, config, extract)