Truncate a string and add an ellipsis (three dots) to the end if it was too long :param s: string to possibly truncate :param length: length to truncate the string to
(s: str, length: int = DEFAULT_CURTAIL)
| 113 | |
| 114 | |
| 115 | def truncate(s: str, length: int = DEFAULT_CURTAIL) -> str: |
| 116 | """ |
| 117 | Truncate a string and add an ellipsis (three dots) to the end if it was too long |
| 118 | |
| 119 | :param s: string to possibly truncate |
| 120 | :param length: length to truncate the string to |
| 121 | """ |
| 122 | if len(s) > length: |
| 123 | s = s[: length - 1] + '…' |
| 124 | return s |
| 125 | |
| 126 | |
| 127 | def args_to_string(args: Sequence[Any], kwargs: dict[str, Any]) -> str: |
no outgoing calls
no test coverage detected
searching dependent graphs…