Skip to content

selection

6 functions / 0 types

Index

FunctionDescription
clearClear all nodes from the selection.
pop_nodePop the most recently selected node from the selection (the same node last_selected reads).
push_nodePush a node onto the selection, starting a new selection if none exists.
readRead the current selection, returning the non-empty selected nodes in slot order.
set_selectionReplace the entire selection with a new ordered list of nodes.
set_slotSet a specific selection slot by index.

clear

def clear(*, _transaction_id: str | None = None) -> None

Clear all nodes from the selection.

Returns None.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

pop_node

def pop_node(
    *,
    _transaction_id: str | None = None
) -> types.project.object.ProjectNode | None

Pop the most recently selected node from the selection (the same node last_selected reads).

Returns ProjectNode | None.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

push_node

def push_node(
    *,
    node: types.project.object.ProjectNode,
    _transaction_id: str | None = None
) -> None

Push a node onto the selection, starting a new selection if none exists.

Returns None.

node : ProjectNode

The node to push.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

read

def read(
    *,
    _transaction_id: str | None = None
) -> tuple[types.project.object.ProjectNode, ...]

Read the current selection, returning the non-empty selected nodes in slot order.

Returns tuple[ProjectNode, ...].

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

set_selection

def set_selection(
    *,
    nodes: list[types.project.object.ProjectNode] | None = None,
    _transaction_id: str | None = None
) -> None

Replace the entire selection with a new ordered list of nodes.

Returns None.

nodes optional : list[ProjectNode] | None

The nodes to select, in slot order. Defaults to None.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.

set_slot

def set_slot(
    *,
    index: int,
    node: types.project.object.ProjectNode | None = None,
    _transaction_id: str | None = None
) -> None

Set a specific selection slot by index.

A node fills the slot, and an absent node clears it. The selection grows with empty slots when index is beyond its current length.

Returns None.

index : int

Slot index to set.

node optional : ProjectNode | None

The node to place in the slot. An absent node clears the slot. Defaults to None.

_transaction_id optional : str | None

Transaction to join. Omit to submit without an explicit transaction. Defaults to None.