MCPcopy
hub / github.com/Textualize/textual / print_bindings

Function print_bindings

tools/widget_documentation.py:17–34  ·  view source on GitHub ↗

Print a table summarising the bindings. The table contains columns for the key(s) that trigger the binding, the method that it calls (and tries to link it to the widget itself), and the description of the binding.

(widget: str, bindings: list[Binding])

Source from the content-addressed store, hash-verified

15
16
17def print_bindings(widget: str, bindings: list[Binding]) -> None:
18 """Print a table summarising the bindings.
19
20 The table contains columns for the key(s) that trigger the binding,
21 the method that it calls (and tries to link it to the widget itself),
22 and the description of the binding.
23 """
24 if bindings:
25 print("BINDINGS")
26 print('"""')
27 print("| Key(s) | Description |")
28 print("| :- | :- |")
29
30 for binding in bindings:
31 print(f"| {binding.key} | {binding.description} |")
32
33 if bindings:
34 print('"""')
35
36
37def print_component_classes(classes: set[str]) -> None:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…