Abbreviate task name.
(S: str, max: int)
| 71 | |
| 72 | |
| 73 | def abbrtask(S: str, max: int) -> str: |
| 74 | """Abbreviate task name.""" |
| 75 | if S is None: |
| 76 | return '???' |
| 77 | if len(S) > max: |
| 78 | module, _, cls = S.rpartition('.') |
| 79 | module = abbr(module, max - len(cls) - 3, False) |
| 80 | return module + '[.]' + cls |
| 81 | return S |
| 82 | |
| 83 | |
| 84 | def indent(t: str, indent: int = 0, sep: str = '\n') -> str: |