예제 #1
0
def _family_type(family, typename, mtype, mextra):
    """Create a type= string for an object, including family= if necessary.
    typename is the builtin type, mtype is the mutated type (or None for
    non-mutants). mextra is mutant-specific data, or None."""

    if getVerbose() == 0 and mtype is None:
        # family tags are technically only necessary for mutated types.
        # we can intuit family for builtin types.
        return 'type="%s"' % typename

    if mtype and len(mtype):
        if mextra:
            mextra = 'extra="%s"' % mextra
        else:
            mextra = ''
        return 'family="%s" type="%s" %s' % (family, mtype, mextra)
    else:
        return 'family="%s" type="%s"' % (family, typename)
예제 #2
0
파일: _pickle.py 프로젝트: Ax47/devSpiral
def _family_type(family,typename,mtype,mextra):
    """Create a type= string for an object, including family= if necessary.
    typename is the builtin type, mtype is the mutated type (or None for
    non-mutants). mextra is mutant-specific data, or None."""

    if getVerbose() == 0 and mtype is None:
        # family tags are technically only necessary for mutated types.
        # we can intuit family for builtin types.
        return 'type="%s"' % typename

    if mtype and len(mtype):
        if mextra:
            mextra = 'extra="%s"' % mextra
        else:
            mextra = ''
        return 'family="%s" type="%s" %s' % (family,mtype,mextra)
    else:
        return 'family="%s" type="%s"' % (family,typename)