(self, s: str, partial: bool = False)
| 448 | EntityAddress, that is, IP address[/nonce] |
| 449 | """ |
| 450 | def valid(self, s: str, partial: bool = False) -> None: |
| 451 | nonce = None |
| 452 | if '/' in s: |
| 453 | ip, nonce = s.split('/') |
| 454 | if nonce.endswith(']'): |
| 455 | nonce = nonce[:-1] |
| 456 | ip += ']' |
| 457 | else: |
| 458 | ip = s |
| 459 | super(self.__class__, self).valid(ip) |
| 460 | if nonce: |
| 461 | nonce_int = None |
| 462 | try: |
| 463 | nonce_int = int(nonce) |
| 464 | except ValueError: |
| 465 | pass |
| 466 | if nonce_int is None or nonce_int < 0: |
| 467 | raise ArgumentValid( |
| 468 | '{0}: invalid entity, nonce {1} not integer > 0'. |
| 469 | format(s, nonce) |
| 470 | ) |
| 471 | self.val = s |
| 472 | |
| 473 | def __str__(self) -> str: |
| 474 | return '<EntityAddr>' |
nothing calls this directly
no test coverage detected