def _read_and_convert(self, filepath, all_values):
d = get_dict_from_ini(filepath)<EOL>result = {}<EOL>for key, func in self.ini_converter_dict.items():<EOL><INDENT>if not all_values and key not in d:<EOL><INDENT>continue<EOL><DEDENT>try:<EOL><INDENT>value = d[key]<EOL><DEDENT>except KeyError as err:<EOL><INDENT>traceback.print_exc()<EOL>print("<STR_LIT:_>" * <NUM_LIT>)<EOL>print("<STR_LIT>" % err)<EOL>print("<STR_LIT>" % filepath)<EOL>try:<EOL><INDENT>print(pprint.pformat(d))<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>print("<STR_LIT:\n>")<EOL>if click.confirm("<STR_LIT>"):<EOL><INDENT>self.open_editor()<EOL><DEDENT>sys.exit(-<NUM_LIT:1>)<EOL><DEDENT>if func:<EOL><INDENT>try:<EOL><INDENT>value = func(value)<EOL><DEDENT>except (KeyError, ValueError) as err:<EOL><INDENT>edit_ini(self.ini_filepath)<EOL>raise Exception("<STR_LIT>" % (err, self.ini_filepath))<EOL><DEDENT><DEDENT>result[key] = value<EOL><DEDENT>return result<EOL>
if all_values==True: the readed ini file must contain all values