lookatme.utils package¶
Module contents¶
-
lookatme.utils.
can_style_item
(item)[source]¶ Return true/false if
style_text
can work with the given item
-
lookatme.utils.
core_widget
(w) → urwid.widget.Widget[source]¶ Resolve a wrapped widget to its core widget value
-
lookatme.utils.
dict_deep_update
(to_update, new_vals)[source]¶ Deeply update the to_update dict with the new_vals
-
lookatme.utils.
flatten_dict
(tree_dict: Dict[KT, VT], flat_dict: Dict[KT, VT], prefixes: Optional[List[T]] = None)[source]¶
-
lookatme.utils.
flatten_text
(text, new_spec=None)[source]¶ Return a flattend list of tuples that can be used as the first argument to a new urwid.Text().
Parameters: - text (urwid.Text) – The text to flatten
- new_spec (SmartAttrSpec) – A new spec to merge with existing styles
Returns: list of tuples
-
lookatme.utils.
overwrite_style
(orig_style: Dict[str, str], new_style: Dict[str, str]) → Dict[str, str][source]¶
-
lookatme.utils.
packed_widget_width
(w: urwid.widget.Widget) → int[source]¶ Return the smallest size of the widget without wrapping
-
lookatme.utils.
pile_or_listbox_add
(container, widgets)[source]¶ Add the widget/widgets to the container
-
lookatme.utils.
resolve_bag_of_text_markup_or_widgets
(items)[source]¶ Resolve the list of items into either contiguous urwid.Text() instances, or pre-existing urwid.Widget objects
-
lookatme.utils.
row_text
(rendered_row)[source]¶ Return all text joined together from the rendered row
-
lookatme.utils.
spec_from_stack
(spec_stack: list, filter_fn=None) → urwid.display_common.AttrSpec[source]¶