euporie.core.widgets.pager

Contain a container for the cell output area.

Functions

NamedTuple(typename[, fields])

Typed version of namedtuple.

add_cmd(**kwargs)

Add a command to the centralized command system.

find_route(from_, to)

Find the shortest conversion path between two formats.

get_app()

Get the current active (running) Application.

load_registered_bindings(*names[, config])

Assign key-bindings to commands based on a dictionary.

register_bindings(bindings)

Update the key-binding registry.

Classes

Box(body[, padding, padding_left, ...])

Add padding around a container.

CellOutput(json, parent)

Represent a single cell output.

CellOutputDataElement(mime, data, metadata, ...)

A cell output element which display data.

Condition(func)

Turn any callable into a Filter.

ConditionalContainer(content, filter)

Wrapper around any other container that can change the visibility.

Datum(data, *args, **kwargs)

Class for storing and converting display data.

Dimension([min, max, weight, preferred])

Specified dimension (width/height) of a user control or window.

Display(datum[, height, width, focusable, ...])

Rich output displays.

DynamicContainer(get_container)

Container class that dynamically returns any Container.

HSplit(children[, window_too_small, align, ...])

Several layouts, one stacked above/under the other.

Line([char, width, height, collapse, style])

Draw a horizontal or vertical line.

Pager([height])

Interactive help pager.

PagerOutput(json, parent)

Display pager output.

PagerOutputDataElement(mime, data, metadata, ...)

A cell output element which display data.

PagerState(code, cursor_pos, data)

A named tuple which describes the state of a pager.

PurePath(*args, **kwargs)

Base class for manipulating paths without I/O.

class euporie.core.widgets.pager.Pager(height: AnyDimension | None = None)

Bases: object

Interactive help pager.

A pager which displays information at the bottom of a tab.

focus() None

Focus the pager.

hide() None

Clear and hide the pager.

property state: euporie.core.widgets.pager.PagerState | None

Return the pager’s current state.

class euporie.core.widgets.pager.PagerOutput(json: dict[str, Any], parent: OutputParent | None)

Bases: CellOutput

Display pager output.

property data: dict[str, Any]

Return dictionary of mime types and data for this output.

This generates similarly structured data objects for markdown cells and text output streams.

Returns:

JSON dictionary mapping mimes type to representation data.

property element: CellOutputElement

Get the element for the currently selected mime type.

get_element(mime: str) CellOutputElement

Return the currently displayed cell element.

make_element(mime: str) CellOutputElement

Create a container for the pager output mime-type if it doesn’t exist.

Parameters:

mime – The mime-type to make the container for

Returns:

A PagerOutputDataElement container for the currently selected mime-type.

scroll_left() None

Scroll the currently visible output left.

scroll_right() None

Scroll the currently visible output right.

property selected_mime: str

Return the selected mime-type, selecting the first by default.

update() None

Update the output by updating all child containers.

class euporie.core.widgets.pager.PagerOutputDataElement(mime: str, data: dict[str, Any], metadata: dict, parent: OutputParent | None)

Bases: CellOutputDataElement

A cell output element which display data.

property data: Any

Return the control’s display data.

scroll_left() None

Scroll the output left.

scroll_right() None

Scroll the output right.

class euporie.core.widgets.pager.PagerState(code: str, cursor_pos: int, data: dict)

Bases: NamedTuple

A named tuple which describes the state of a pager.

code: str

Alias for field number 0

count(value, /)

Return number of occurrences of value.

cursor_pos: int

Alias for field number 1

data: dict

Alias for field number 2

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.