def __str__(self): if self.isAny: return "" out = BaseMap.__str__(self) if len(self) > 1 and not self.isRange: out = "{ " + out + " }" return out
def __str__(self): self.ipList = self.values() for i in range(len(self.ipList)): if not isinstance(self.ipList[i], IPv4Network): self.ipList[i] = IPv4Network(self.ipList[i], 32) self._mapToDict() out = "any" if self.isAny else BaseMap.__str__(self) out = out.replace("/32", "") if len(self) > 1 and not self.isAny: out = "{ " + out + " }" self.ipList = self.values() for i in range(len(self.ipList)): if self.ipList[i].prefixlen == 32: self.ipList[i] = IPv4Address(self.ipList[i].ip) self._mapToDict() return out