Lines Matching refs:ip_str
503 def _prefix_from_ip_string(cls, ip_str): argument
517 ip_int = cls._ip_int_from_string(ip_str)
519 cls._report_invalid_netmask(ip_str)
534 cls._report_invalid_netmask(ip_str)
1177 def _ip_int_from_string(cls, ip_str): argument
1190 if not ip_str:
1193 octets = ip_str.split('.')
1195 raise AddressValueError("Expected 4 octets in %r" % ip_str)
1200 raise AddressValueError("%s in %r" % (exc, ip_str)) from None
1610 def _ip_int_from_string(cls, ip_str): argument
1623 if not ip_str:
1626 parts = ip_str.split(':')
1631 msg = "At least %d parts expected in %r" % (_min_parts, ip_str)
1639 raise AddressValueError("%s in %r" % (exc, ip_str)) from None
1648 msg = "At most %d colons permitted in %r" % (_max_parts-1, ip_str)
1658 msg = "At most one '::' permitted in %r" % ip_str
1672 raise AddressValueError(msg % ip_str) # ^: requires ^::
1677 raise AddressValueError(msg % ip_str) # :$ requires ::$
1681 raise AddressValueError(msg % (cls._HEXTET_COUNT-1, ip_str))
1688 raise AddressValueError(msg % (cls._HEXTET_COUNT, ip_str))
1691 raise AddressValueError(msg % ip_str) # ^: requires ^::
1694 raise AddressValueError(msg % ip_str) # :$ requires ::$
1711 raise AddressValueError("%s in %r" % (exc, ip_str)) from None
1824 ip_str = str(self.network_address)
1826 ip_str = str(self.ip)
1828 ip_str = str(self)
1830 ip_int = self._ip_int_from_string(ip_str)
1847 def _split_scope_id(ip_str): argument
1859 addr, sep, scope_id = ip_str.partition('%')
1863 raise AddressValueError('Invalid IPv6 address: "%r"' % ip_str)
1922 ip_str = super().__str__()
1923 return ip_str + '%' + self._scope_id if self._scope_id else ip_str