(pretty_printers)
return (enabled, total)
Return a 2-tuple of number of enabled and total printers.
Return a 2-tuple of number of enabled and total printers.
Return a 2 - tuple of number of enabled and total printers .
def count_enabled_printers(pretty_printers):
    """Return a 2-tuple of number of enabled and total printers."""
    enabled = 0
    total = 0
    for printer in pretty_printers:
        if (hasattr(printer, "subprinters")
            and printer.subprinters is not None):
            if printer_enabled_p(printer):
                for subprinter in printer.subprinters:
                    if printer_enabled_p(subprinter):
                        enabled += 1
            total += len(printer.subprinters)
        else:
            if printer_enabled_p(printer):
                enabled += 1
            total += 1
    return (enabled, total)
def count_enabled_printers ( pretty_printers ) : enabled = 0 total = 0 for printer in pretty_printers : if ( hasattr ( printer , "subprinters" ) and printer . subprinters is not None ) : if printer_enabled_p ( printer ) : for subprinter in printer . subprinters : if printer_enabled_p ( subprinter ) : enabled += 1 total += len ( printer . subprinters ) else : if printer_enabled_p ( printer ) : enabled += 1 total += 1 return ( enabled , total )