(option, opt_str, value, parser)
Given a value spelled "algo:digest", append the digest to a list
    pointed to in a dict by the algo name.
Given a value spelled "algo:digest", append the digest to a list
    pointed to in a dict by the algo name.
Given a value spelled algo : digest append the digest to a list pointed to in a dict by the algo name .
def _handle_merge_hash(option, opt_str, value, parser):
    # type: (Option, str, str, OptionParser) -> None
    """Given a value spelled "algo:digest", append the digest to a list
    pointed to in a dict by the algo name."""
    if not parser.values.hashes:
        parser.values.hashes = {}
    try:
        algo, digest = value.split(':', 1)
    except ValueError:
        parser.error('Arguments to %s must be a hash name '
                     'followed by a value, like --hash=sha256:abcde...' %
                     opt_str)
    if algo not in STRONG_HASHES:
        parser.error('Allowed hash algorithms for %s are %s.' %
                     (opt_str, ', '.join(STRONG_HASHES)))
    parser.values.hashes.setdefault(algo, []).append(digest)
def _handle_merge_hash ( option , opt_str , value , parser ) : # type: (Option, str, str, OptionParser) -> None if not parser . values . hashes : parser . values . hashes = { } try : algo , digest = value . split ( ':' , 1 ) except ValueError : parser . error ( 'Arguments to %s must be a hash name ' 'followed by a value, like --hash=sha256:abcde...' % opt_str ) if algo not in STRONG_HASHES : parser . error ( 'Allowed hash algorithms for %s are %s.' % ( opt_str , ', ' . join ( STRONG_HASHES ) ) ) parser . values . hashes . setdefault ( algo , [ ] ) . append ( digest )