(self, field: str, message: str)
| 31 | self.widths[e] = int(width) |
| 32 | |
| 33 | def truncate(self, field: str, message: str): |
| 34 | # 0 means no width limit applied |
| 35 | if not self.widths.get(field): |
| 36 | return message |
| 37 | |
| 38 | length = 3 if self.widths[field] < 3 else self.widths[field] |
| 39 | return ( |
| 40 | message[: length - 3] + "..." |
| 41 | if len(message) > length |
| 42 | else message.ljust(length) |
| 43 | ) |
| 44 | |
| 45 | |
| 46 | class Color(Enum): |
no outgoing calls
no test coverage detected