Lines Matching refs:ip_str
502 def _prefix_from_ip_string(cls, ip_str): argument
516 ip_int = cls._ip_int_from_string(ip_str)
518 cls._report_invalid_netmask(ip_str)
533 cls._report_invalid_netmask(ip_str)
1100 def _ip_int_from_string(cls, ip_str): argument
1113 if not ip_str:
1116 octets = ip_str.split('.')
1118 raise AddressValueError("Expected 4 octets in %r" % ip_str)
1123 raise AddressValueError("%s in %r" % (exc, ip_str)) from None
1206 def _is_hostmask(self, ip_str): argument
1216 bits = ip_str.split('.')
1631 def _ip_int_from_string(cls, ip_str): argument
1644 if not ip_str:
1647 parts = ip_str.split(':')
1652 msg = "At least %d parts expected in %r" % (_min_parts, ip_str)
1660 raise AddressValueError("%s in %r" % (exc, ip_str)) from None
1669 msg = "At most %d colons permitted in %r" % (_max_parts-1, ip_str)
1679 msg = "At most one '::' permitted in %r" % ip_str
1693 raise AddressValueError(msg % ip_str) # ^: requires ^::
1698 raise AddressValueError(msg % ip_str) # :$ requires ::$
1702 raise AddressValueError(msg % (cls._HEXTET_COUNT-1, ip_str))
1709 raise AddressValueError(msg % (cls._HEXTET_COUNT, ip_str))
1712 raise AddressValueError(msg % ip_str) # ^: requires ^::
1715 raise AddressValueError(msg % ip_str) # :$ requires ::$
1732 raise AddressValueError("%s in %r" % (exc, ip_str)) from None
1845 ip_str = str(self.network_address)
1847 ip_str = str(self.ip)
1849 ip_str = str(self)
1851 ip_int = self._ip_int_from_string(ip_str)