Print a human-readable summary of efuse contents

def summary(esp, efuses, args):
    """ Print a human-readable summary of efuse contents """
    ROW_FORMAT = "%-22s %-50s%s= %s %s %s"
    print(ROW_FORMAT.replace("-50", "-12") % ("EFUSE_NAME", "Description", "", "[Meaningful Value]", "[Readable/Writeable]", "(Hex Value)"))
    print("-" * 88)
    for category in set(e.category for e in efuses):
        print("%s fuses:" % category.title())
        for e in (e for e in efuses if e.category == category):
            raw = e.get_raw()
            try:
                raw = "(0x%x)" % raw
            except TypeError:
                raw = ""
            (readable, writeable) = (e.is_readable(), e.is_writeable())
            if readable and writeable:
                perms = "R/W"
            elif readable:
                perms = "R/-"
            elif writeable:
                perms = "-/W"
            else:
                perms = "-/-"
            value = str(e.get())
            if not readable:
                value = value.replace("0", "?")
            print(ROW_FORMAT % (e.register_name, e.description, "\n  " if len(value) > 20 else "", value, perms, raw))
        print("")
    sdio_force = efuses["XPD_SDIO_FORCE"]
    sdio_tieh = efuses["XPD_SDIO_TIEH"]
    sdio_reg = efuses["XPD_SDIO_REG"]
    if sdio_force.get() == 0:
        print("Flash voltage (VDD_SDIO) determined by GPIO12 on reset (High for 1.8V, Low/NC for 3.3V).")
    elif sdio_reg.get() == 0:
        print("Flash voltage (VDD_SDIO) internal regulator disabled by efuse.")
    elif sdio_tieh.get() == 0:
        print("Flash voltage (VDD_SDIO) set to 1.8V by efuse.")
    else:
        print("Flash voltage (VDD_SDIO) set to 3.3V by efuse.")
    warnings = efuses.get_coding_scheme_warnings()
    if warnings:
        print("WARNING: Coding scheme has encoding bit error warnings (0x%x)" % warnings)