def _get_opt(config, key, option, opt_type):
for opt_key in [option, option.replace('<STR_LIT:->', '<STR_LIT:_>')]:<EOL><INDENT>if not config.has_option(key, opt_key):<EOL><INDENT>continue<EOL><DEDENT>if opt_type == bool:<EOL><INDENT>return config.getbool(key, opt_key)<EOL><DEDENT>if opt_type == int:<EOL><INDENT>return config.getint(key, opt_key)<EOL><DEDENT>if opt_type == str:<EOL><INDENT>return config.get(key, opt_key)<EOL><DEDENT>if opt_type == list:<EOL><INDENT>return _parse_list_opt(config.get(key, opt_key))<EOL><DEDENT>raise ValueError("<STR_LIT>" % opt_type)<EOL><DEDENT>
Get an option from a configparser with the given type.