Perform ljust, center, rjust against string or list-like
(self, texts: Any, max_len: int, mode: str = "right")
| 526 | return len(text) |
| 527 | |
| 528 | def justify(self, texts: Any, max_len: int, mode: str = "right") -> list[str]: |
| 529 | """ |
| 530 | Perform ljust, center, rjust against string or list-like |
| 531 | """ |
| 532 | if mode == "left": |
| 533 | return [x.ljust(max_len) for x in texts] |
| 534 | elif mode == "center": |
| 535 | return [x.center(max_len) for x in texts] |
| 536 | else: |
| 537 | return [x.rjust(max_len) for x in texts] |
| 538 | |
| 539 | def adjoin(self, space: int, *lists: Any, **kwargs: Any) -> str: |
| 540 | return adjoin(space, *lists, strlen=self.len, justfunc=self.justify, **kwargs) |