runner.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:rotest 作者: gregoil 项目源码 文件源码
def output_option_parser(option, opt, value, parser):
    """Parse the string of outputs and validate it.

    Args:
        option (optparse.Option): the Option instnace.
        opt (str): option calling format.
        value (str): user input for the option.
        parser (optparse.OptionParser): the parser of the option.

    Raises:
        optparse.OptionValueError. unsupported handler requested.
    """
    output_options = get_result_handler_options()

    handlers = value.split(',')

    for handler in handlers:
        if handler not in output_options:
            raise optparse.OptionValueError(
                'Unsupported handler %r, supported handlers: %s' %
                (handler, ", ".join(output_options)))

    setattr(parser.values, option.dest, handlers)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号