(
self,
json: str,
indent: Union[None, int, str] = 2,
highlight: bool = True,
skip_keys: bool = False,
ensure_ascii: bool = False,
check_circular: bool = True,
allow_nan: bool = True,
default: Optional[Callable[[Any], Any]] = None,
sort_keys: bool = False,
)
| 23 | """ |
| 24 | |
| 25 | def __init__( |
| 26 | self, |
| 27 | json: str, |
| 28 | indent: Union[None, int, str] = 2, |
| 29 | highlight: bool = True, |
| 30 | skip_keys: bool = False, |
| 31 | ensure_ascii: bool = False, |
| 32 | check_circular: bool = True, |
| 33 | allow_nan: bool = True, |
| 34 | default: Optional[Callable[[Any], Any]] = None, |
| 35 | sort_keys: bool = False, |
| 36 | ) -> None: |
| 37 | data = loads(json) |
| 38 | json = dumps( |
| 39 | data, |
| 40 | indent=indent, |
| 41 | skipkeys=skip_keys, |
| 42 | ensure_ascii=ensure_ascii, |
| 43 | check_circular=check_circular, |
| 44 | allow_nan=allow_nan, |
| 45 | default=default, |
| 46 | sort_keys=sort_keys, |
| 47 | ) |
| 48 | highlighter = JSONHighlighter() if highlight else NullHighlighter() |
| 49 | self.text = highlighter(json) |
| 50 | self.text.no_wrap = True |
| 51 | self.text.overflow = None |
| 52 | |
| 53 | @classmethod |
| 54 | def from_data( |
nothing calls this directly
no test coverage detected