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)
1176 def _ip_int_from_string(cls, ip_str): argument
1189 if not ip_str:
1192 octets = ip_str.split('.')
1194 raise AddressValueError("Expected 4 octets in %r" % ip_str)
1199 raise AddressValueError("%s in %r" % (exc, ip_str)) from None
1609 def _ip_int_from_string(cls, ip_str): argument
1622 if not ip_str:
1625 parts = ip_str.split(':')
1630 msg = "At least %d parts expected in %r" % (_min_parts, ip_str)
1638 raise AddressValueError("%s in %r" % (exc, ip_str)) from None
1647 msg = "At most %d colons permitted in %r" % (_max_parts-1, ip_str)
1657 msg = "At most one '::' permitted in %r" % ip_str
1671 raise AddressValueError(msg % ip_str) # ^: requires ^::
1676 raise AddressValueError(msg % ip_str) # :$ requires ::$
1680 raise AddressValueError(msg % (cls._HEXTET_COUNT-1, ip_str))
1687 raise AddressValueError(msg % (cls._HEXTET_COUNT, ip_str))
1690 raise AddressValueError(msg % ip_str) # ^: requires ^::
1693 raise AddressValueError(msg % ip_str) # :$ requires ::$
1710 raise AddressValueError("%s in %r" % (exc, ip_str)) from None
1823 ip_str = str(self.network_address)
1825 ip_str = str(self.ip)
1827 ip_str = str(self)
1829 ip_int = self._ip_int_from_string(ip_str)
1846 def _split_scope_id(ip_str): argument
1858 addr, sep, scope_id = ip_str.partition('%')
1862 raise AddressValueError('Invalid IPv6 address: "%r"' % ip_str)
1921 ip_str = super().__str__()
1922 return ip_str + '%' + self._scope_id if self._scope_id else ip_str