euporie.core.comm.base

Define the base class for a Comm object and it’s representation.

Functions

abstractmethod(funcobj)

A decorator indicating abstract methods.

get_app()

Get the current active (running) Application.

Classes

ABCMeta(name, bases, namespace, /, **kwargs)

Metaclass for defining Abstract Base Classes (ABCs).

Comm(comm_container, comm_id, data, buffers)

A base-class for all comm objects, which support syncing traits with the kernel.

CommView(container[, setters])

Hold a container and methods to update its attributes.

Display(data, format_[, path, fg_color, ...])

Rich output displays.

UnimplementedComm(comm_container, comm_id, ...)

Represent a Comm object which is not implemented in euporie.core.

WeakKeyDictionary([dict])

Mapping class that references keys weakly.

class euporie.core.comm.base.Comm(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: object

A base-class for all comm objects, which support syncing traits with the kernel.

create_view(parent: OutputParent) CommView

Create a new CommView for this Comm.

new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

abstract process_data(data: dict, buffers: Sequence[bytes]) None

Process a comm_msg data / buffers.

update_views(changes: dict) None

Update all the active views of this Comm.

class euporie.core.comm.base.CommView(container: AnyContainer, setters: Mapping[str, Callable[..., None]] | None = None)

Bases: object

Hold a container and methods to update its attributes.

update(changes: dict[str, Any]) None

Update the view to reflect changes in the Comm.

Calls any setter functions defined for the changed keys with the changed values as arguments.

Parameters

changes – A dictionary mapping changed key names to new values.

class euporie.core.comm.base.UnimplementedComm(comm_container: KernelTab, comm_id: str, data: dict, buffers: Sequence[bytes])

Bases: euporie.core.comm.base.Comm

Represent a Comm object which is not implemented in euporie.core.

create_view(parent: OutputParent) CommView

Create a new CommView for this Comm.

new_view(parent: OutputParent) CommView

Create and register a new CommView for this Comm.

process_data(data: dict, buffers: Sequence[bytes]) None

Doe nothing when data is received.

update_views(changes: dict) None

Update all the active views of this Comm.