示例#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())
示例#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())
示例#3
0
文件: render.py 项目: willingc/edgedb
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())
示例#4
0
文件: render.py 项目: willingc/edgedb
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())