Function
_fmt_value
(val: object, indent: str, color: str)
Source from the content-addressed store, hash-verified
| 133 | |
| 134 | |
| 135 | def _fmt_value(val: object, indent: str, color: str) -> str: |
| 136 | s = str(val) |
| 137 | lines = s.split("\n") |
| 138 | if len(lines) == 1: |
| 139 | return f"{color}{indent}{s}{_RESET}" |
| 140 | out = [f"{color}{indent}{lines[0]}"] |
| 141 | for line in lines[1:]: |
| 142 | out.append(f"{indent} {line}") |
| 143 | out[-1] += _RESET |
| 144 | return "\n".join(out) |
| 145 | |
| 146 | |
| 147 | def _fmt_text_diff(old_text: object, new_text: object, indent: str) -> str | None: |
Tested by
no test coverage detected