(self, s, partial=False)
| 605 | self.strings = list(e.value for e in self.enum) |
| 606 | |
| 607 | def valid(self, s, partial=False): |
| 608 | if not partial: |
| 609 | if s not in self.strings: |
| 610 | # show as __str__ does: {s1|s2..} |
| 611 | raise ArgumentValid("{0} not in {1}".format(s, self)) |
| 612 | self.val = s |
| 613 | return |
| 614 | |
| 615 | # partial |
| 616 | for t in self.strings: |
| 617 | if t.startswith(s): |
| 618 | self.val = s |
| 619 | return |
| 620 | raise ArgumentValid("{0} not in {1}". format(s, self)) |
| 621 | |
| 622 | def __str__(self): |
| 623 | if len(self.strings) == 1: |
nothing calls this directly
no test coverage detected