| 573 | |
| 574 | |
| 575 | class RandTermString(RandBin): |
| 576 | def __init__(self, size, term): |
| 577 | # type: (Union[int, RandNum], bytes) -> None |
| 578 | self.term = bytes_encode(term) |
| 579 | super(RandTermString, self).__init__(size=size) |
| 580 | self.chars = self.chars.replace(self.term, b"") |
| 581 | |
| 582 | def _command_args(self): |
| 583 | # type: () -> str |
| 584 | return ", ".join((super(RandTermString, self)._command_args(), |
| 585 | "term=%r" % self.term)) |
| 586 | |
| 587 | def _fix(self): |
| 588 | # type: () -> bytes |
| 589 | return RandBin._fix(self) + self.term |
| 590 | |
| 591 | |
| 592 | class RandIP(_RandString[str]): |