'Provides a short description of our policy chain, similar to a
microdescriptor. This excludes entries that don\'t cover all IP
addresses, and is either white-list or blacklist policy based on
the final entry. For instance...
>>> policy = ExitPolicy(\'accept *:80\', \'accept *:443\', \'reject *:*\')
>>> policy.summary()
\'accept 80, 443\'
>>> policy = ExitPolicy(\'accept *:443\', \'reject *:1-1024\', \'accept *:*\')
>>> policy.summary()
\'reject 1-442, 444-1024\'
:returns: **str** with a concise summary for our policy'

@lru_cache()
def summary(self):

    is_whitelist = (not self._is_allowed_default)
    for rule in self._get_rules():
        if (rule.is_address_wildcard() and rule.is_port_wildcard()):
            is_whitelist = (not rule.is_accept)
            break
    (display_ports, skip_ports) = ([], set())
    for rule in self._get_rules():
        if (not rule.is_address_wildcard()):
            continue
        elif rule.is_port_wildcard():
            break
        for port in range(rule.min_port, (rule.max_port + 1)):
            if (port in skip_ports):
                continue
            if (rule.is_accept == is_whitelist):
                display_ports.append(port)
            skip_ports.add(port)
    if display_ports:
        (display_ranges, temp_range) = ([], [])
        display_ports.sort()
        display_ports.append(None)
        for port in display_ports:
            if ((not temp_range) or ((temp_range[(-1)] + 1) == port)):
                temp_range.append(port)
            else:
                if (len(temp_range) > 1):
                    display_ranges.append(('%i-%i' % (temp_range[0], temp_range[(-1)])))
                else:
                    display_ranges.append(str(temp_range[0]))
                temp_range = [port]
    else:
        is_whitelist = (not is_whitelist)
        display_ranges = ['1-65535']
    label_prefix = ('accept    ' if is_whitelist else 'reject    ')
    return (label_prefix + ',    '.join(display_ranges)).strip()
