base
Extension Classes
SortedBindingsApp
#
Bases: App[str]
Textual App with Sorted Bindings
Source code in browsr/base.py
namespace_bindings: dict[str, tuple[DOMNode, Binding]]
property
#
Return the namespace bindings, optionally sorted by weight
Bindings are currently returned as they're rendered in the current namespace (screen). This method can be overridden to return bindings in a specific order.
Rules: - Binding weights must be greater than 0 and less than 10000 - If a binding is not in the BINDING_WEIGHTS dict, it will be given a weight of 500 + its current position in the namespace. - Specified weights cannot overlap with the default weights (stay away from the 500 range)
Raises:
Type | Description |
---|---|
ValueError
|
If binding weights are invalid |
Returns:
Type | Description |
---|---|
dict[str, tuple[DOMNode, Binding]]
|
A dictionary of bindings |
TextualAppContext
dataclass
#
App Context Object
Source code in browsr/base.py
path: UPath
property
#
Resolve file_path
to a UPath object