euporie.preview.tabs.notebook
A notebook which renders cells one cell at a time.
Functions
|
Register a new config item. |
Classes
|
The main notebook container class. |
|
Add padding around a container. |
|
A kernel_tab cell element. |
|
Wrapper around any other container that can change the visibility. |
|
Specified dimension (width/height) of a user control or window. |
|
Container class that dynamically returns any Container. |
|
A notebook tab which renders cells sequentially. |
|
A container which displays all it's children in a vertical list. |
|
Several layouts, one stacked left/right of the other. |
|
Container that holds a control. |
- class euporie.preview.tabs.notebook.PreviewNotebook(app: BaseApp, path: Path | None = None, use_kernel_history: bool = False)
Bases:
BaseNotebook
A notebook tab which renders cells sequentially.
- after_render(app: Application[Any]) None
Close the tab if all cells have been rendered.
- before_render(app: Application[Any]) None
Run the cell before rendering it if needed.
- bg_init = False
- change_kernel(msg: str | None = None, startup: bool = False) None
Prompt the user to select a new kernel.
- comm_open(content: dict, buffers: Sequence[bytes]) None
Register a new kernel Comm object in the notebook.
- container: AnyContainer
- property current_input: KernelInput
Return the currently active kernel input, if any.
- default_callbacks: MsgCallbacks
- edit_mode = False
- get_cell_by_id(cell_id: str) euporie.core.widgets.cell.Cell | None
Return a reference to the Cell container with a given cell id.
- init_kernel(kernel: Kernel | None = None, comms: dict[str, Comm] | None = None, use_kernel_history: bool = False, connection_file: Path | None = None) None
Set up the tab’s kernel and related components.
- property kernel_display_name: str
Return the display name of the kernel defined in the notebook JSON.
- property kernel_lang_file_ext: str
Return the display name of the kernel defined in the notebook JSON.
- kernel_started(result: dict | None = None) None
Resume rendering the app when the kernel has started.
- load_container() AnyContainer
Load the notebook’s main container.
- new_output_default(output_json: dict[str, Any], own: bool) None
Add a new output without a cell to the currently selected cell.
- rendered_cells() list[euporie.core.widgets.cell.Cell]
Return a list of rendered notebooks’ cells.
- reports: WeakKeyDictionary[LspClient, Report]
- run_cell(cell: Cell, wait: bool = False, callback: Callable[..., None] | None = None) None
Run a cell.
- Parameters:
cell – The rendered cell to run. If
None
, runs the currently selected cell.wait – If
True
, blocks until cell execution is finishedcallback – Function to run after completion
- save(path: Path | None = None, cb: Callable | None = None) None
Write the notebook’s JSON to the current notebook’s file.
Additionally save the widget state to the notebook metadata.
- Parameters:
path – An optional new path at which to save the tab
cb – A callback to run if after saving the notebook.
- select(cell_index: int, extend: bool = False, position: int | None = None, scroll: bool = False) None
Select a cell.
- suggester: AutoSuggest