Exemple #1
0
def render_json(repl_ctx: context.ReplContext,
                data: str,
                max_width: Optional[int] = None) -> None:
    data = json.loads(data)
    buf = terminal.Buffer(max_width=max_width, styled=repl_ctx.use_colors)
    render_ctx = _json.RenderContext(path=())
    _json.walk(data, repl_ctx, render_ctx, buf)
    print(buf.flush())
Exemple #2
0
def render_binary(
    repl_ctx: context.ReplContext,
    data: Any,
    max_width: Optional[int] = None
) -> None:
    buf = terminal.Buffer(max_width=max_width, styled=repl_ctx.use_colors)
    _binary.walk(data, repl_ctx, buf)
    print(buf.flush())
Exemple #3
0
def render_json(repl_ctx: context.ReplContext, data: str, max_width=None):
    data = json.loads(data)
    buf = terminal.Buffer(max_width=max_width, styled=repl_ctx.use_colors)
    JSONRenderer.walk(data, repl_ctx, buf)
    print(buf.flush())
Exemple #4
0
def render_binary(repl_ctx: context.ReplContext, data, max_width=None):
    buf = terminal.Buffer(max_width=max_width, styled=repl_ctx.use_colors)
    BinaryRenderer.walk(data, repl_ctx, buf)
    print(buf.flush())