lookatme.widgets.table module¶
Defines a basic Table widget for urwid
-
class
lookatme.widgets.table.
SortSetting
[source]¶ Bases:
object
-
ASCENDING
= 1¶
-
DEFAULT
= 0¶
-
DESCENDING
= 2¶
-
-
class
lookatme.widgets.table.
Table
(ctx: lookatme.render.context.Context, header: Dict[KT, VT], body: Optional[Dict[KT, VT]])[source]¶ Bases:
urwid.container.Pile
-
create_cells
(rows, base_spec=None, header=False) → List[List[urwid.container.Pile]][source]¶ Create the rows for the body, optionally calling a modifier function on each created cell Text. The modifier must accept an urwid.Text object and must return an urwid.Text object.
-
gen_cells
(row: List[urwid.container.Pile], row_specs: Tuple[urwid.display_common.AttrSpec, urwid.display_common.AttrSpec]) → List[Tuple[int, urwid.container.Pile]][source]¶
-
normalize_body
()[source]¶ Normalize the cells in the body - truncate all cells that go beyond the number of headers, and add blank cells if we’re missing any
-
row_specs
(row_idx: int, is_header: bool) → Tuple[urwid.display_common.AttrSpec, urwid.display_common.AttrSpec][source]¶ Return the row-specific specs (text and general) for the given row
-
signals
= ['change']¶
-
validate_row
(row: Dict[KT, VT])[source]¶ Validate that the provided row is a tr_open, with th_open or td_open children.
-