MCPcopy
hub / github.com/Textualize/rich / render

Function render

tests/test_columns.py:31–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29
30
31def render():
32 console = Console(file=io.StringIO(), width=100, legacy_windows=False)
33
34 console.rule("empty")
35 empty_columns = Columns([])
36 console.print(empty_columns)
37 columns = Columns(COLUMN_DATA)
38 columns.add_renderable("Myrmecophaga tridactyla")
39 console.rule("optimal")
40 console.print(columns)
41 console.rule("optimal, expand")
42 columns.expand = True
43 console.print(columns)
44 console.rule("column first, optimal")
45 columns.column_first = True
46 columns.expand = False
47 console.print(columns)
48 console.rule("column first, right to left")
49 columns.right_to_left = True
50 console.print(columns)
51 console.rule("equal columns, expand")
52 columns.equal = True
53 columns.expand = True
54 console.print(columns)
55 console.rule("fixed width")
56 columns.width = 16
57 columns.expand = False
58 console.print(columns)
59 console.print()
60 render_result = console.file.getvalue()
61 print(render_result)
62 print(repr(render_result))
63 return render_result
64
65
66def test_render():

Callers 2

test_renderFunction · 0.70
test_columns.pyFile · 0.70

Calls 6

ruleMethod · 0.95
printMethod · 0.95
add_renderableMethod · 0.95
ConsoleClass · 0.90
ColumnsClass · 0.90
printFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…