def _check_color(option, opt_str, value, parser):
"""OptionParser callback to check if the given color is valid."""
if not helpers.is_color(value):
raise OptionValueError("option %s: invalid color: '%s'" % (opt_str, value)) # noqa
setattr(parser.values, option.dest, value)
评论列表
文章目录