euporie.core.widgets.dialog

Dialog.

Functions

abstractmethod(funcobj)

A decorator indicating abstract methods.

add_cmd(**kwargs)

Add a command to the centralized command system.

align(ft[, how, width, style, placeholder, ...])

Align formatted text at a given width.

focus_next(event)

Focus the next visible Window.

focus_previous(event)

Focus the previous visible Window.

get_app()

Get the current active (running) Application.

has_focus(value)

Enable when this buffer has the focus.

lex(ft, lexer_name)

Format formatted text using a named pygments lexer.

register_bindings(bindings)

Update the key-binding registry.

split_lines(fragments)

Take a single list of (style_str, text) tuples and yield one such list for each line.

to_formatted_text(value[, style, auto_convert])

Convert the given value (which can be formatted text) into a list of text fragments.

Classes

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

Metaclass for defining Abstract Base Classes (ABCs).

AboutDialog(app)

A dialog which shows an "about" message.

Border(body, border, style, str] =, show_borders)

Draw a border around any container.

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

Add padding around a container.

Button(text, on_click, None] | None = None, ...)

A clickable button widget.

ClipboardData([text, type])

Text on the clipboard.

Condition(func)

Turn any callable into a Filter.

ConditionalContainer(content, filter)

Wrapper around any other container that can change the visibility.

ConfirmDialog(app)

A dialog which allows the user to confirm an action.

Dialog(app)

A modal dialog which is displayed above the application.

DialogTitleControl(title, dialog, window)

A draggable dialog titlebar.

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

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

DynamicContainer(get_container)

Container class that dynamically returns any Container.

DynamicKeyBindings(get_key_bindings)

KeyBindings class that can dynamically returns any KeyBindings.

ErrorDialog(app)

A dialog to show unhandled exceptions.

FileBrowser([path, on_select, on_open, ...])

A file browser.

FileDialog(app)

A base dialog to prompt the user for a file path.

Float(content[, top, right, bottom, left, ...])

Float for use in a FloatContainer.

FocusedStyle(body[, style_focus, style_hover])

Apply a style to child containers when focused or hovered.

FormattedTextAlign(value[, names, module, ...])

Alignment of formatted text.

FormattedTextControl([text, style, ...])

Control that displays formatted text.

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

Several layouts, one stacked above/under the other. ::.

KeyBindings()

A container for a set of key bindings.

Label(text[, style, width, ...])

Widget that displays the given text.

LabelledWidget(body, label[, style, ...])

A widget which applies a label to another widget.

MouseButton(value[, names, module, ...])

MouseEventType(value[, names, module, ...])

MsgBoxDialog(app)

A dialog which shows the user a message.

NoKernelsDialog(app)

Dialog to warn the user that no installed kernels were found.

OpenFileDialog(app)

A dialog which prompts the user for a filepath to open.

Path(*args, **kwargs)

PurePath subclass that can make system calls.

PathCompleter([only_directories, get_paths, ...])

Complete for Path variables.

Point(x, y)

SaveAsDialog(app)

A dialog which prompts the user for a filepath to save the current tab.

Select(options, labels, index, indices, ...)

A select widget, which allows one or more items to be selected from a list.

SelectKernelDialog(app)

A dialog which allows the user to select a kernel.

Shadow(body)

Draw a shadow underneath/behind this container.

ShortcutsDialog(app)

Display details of registered key-bindings in a dialog.

SimpleCache([maxsize])

Very simple cache that discards the oldest item when the cache size is exceeded.

Tab(app[, path])

Base class for interface tabs.

Text([text, style, height, min_height, ...])

A text input widget.

UIContent(get_line, StyleAndTextTuples] = >, ...)

Content generated by a user control.

UIControl()

Base class for all user interface controls.

UnsavedDialog(app)

A dialog prompting the user to save unsaved changes.

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

Several layouts, one stacked left/right of the other. ::.

Window([content, width, height, z_index, ...])

Container that holds a control.

WritePosition(xpos, ypos, width, height)

partial

partial(func, *args, **keywords) - new function with partial application of the given arguments and keywords.

class euporie.core.widgets.dialog.AboutDialog(app: BaseApp)

Bases: euporie.core.widgets.dialog.Dialog

A dialog which shows an “about” message.

body_padding_bottom = 0
body_padding_top = 1
get_height() int | None
get_width() int | None
hide(event: KeyPressEvent | None = None) None

Hide the dialog.

load() None

Load the dialog’s body.

show(**params: Any) None

Display and focuses the dialog.

title: AnyFormattedText | None = 'About'
toggle() None

Show or hides the dialog.

class euporie.core.widgets.dialog.ConfirmDialog(app: BaseApp)

Bases: euporie.core.widgets.dialog.Dialog

A dialog which allows the user to confirm an action.

body_padding_bottom = 0
body_padding_top = 1
get_height() int | None
get_width() int | None
hide(event: KeyPressEvent | None = None) None

Hide the dialog.

load(title: str = 'Are you sure?', message: str = 'Please confirm', cb: Callable[[], None] | None = None) None

Load dialog body & buttons.

show(**params: Any) None

Display and focuses the dialog.

title: AnyFormattedText | None = None
toggle() None

Show or hides the dialog.

class euporie.core.widgets.dialog.Dialog(app: BaseApp)

Bases: prompt_toolkit.layout.containers.Float

A modal dialog which is displayed above the application.

Returns focus to the previously selected control when closed.

body_padding_bottom = 0
body_padding_top = 1
get_height() int | None
get_width() int | None
hide(event: KeyPressEvent | None = None) None

Hide the dialog.

abstract load() None

Load the dialog’s body etc.

show(**params: Any) None

Display and focuses the dialog.

title: AnyFormattedText | None = None
toggle() None

Show or hides the dialog.

class euporie.core.widgets.dialog.DialogTitleControl(title: AnyFormattedText, dialog: Dialog, window: Window)

Bases: prompt_toolkit.layout.controls.UIControl

A draggable dialog titlebar.

create_content(width: int, height: int | None) prompt_toolkit.layout.controls.UIContent

Create the title text content.

get_invalidate_events() Iterable[Event[object]]

Return a list of Event objects. This can be a generator. (The application collects all these events, in order to bind redraw handlers to these events.)

get_key_bindings() KeyBindingsBase | None

The key bindings that are specific for this user control.

Return a KeyBindings object if some key bindings are specified, or None otherwise.

is_focusable() bool

Tell whether this user control is focusable.

mouse_handler(mouse_event: MouseEvent) NotImplementedOrNone

Move the dialog when the titlebar is dragged.

move_cursor_down() None

Request to move the cursor down. This happens when scrolling down and the cursor is completely at the top.

move_cursor_up() None

Request to move the cursor up.

preferred_height(width: int, max_available_height: int, wrap_lines: bool, get_line_prefix: GetLinePrefixCallable | None) int | None
preferred_width(max_available_width: int) int | None
reset() None
class euporie.core.widgets.dialog.ErrorDialog(app: BaseApp)

Bases: euporie.core.widgets.dialog.Dialog

A dialog to show unhandled exceptions.

body: AnyContainer
body_padding_bottom = 0
body_padding_top = 1
button_widgets: list[AnyContainer]
buttons: dict[str, Callable | None]
get_height() int | None
get_width() int | None
hide(event: KeyPressEvent | None = None) None

Hide the dialog.

last_focused: FocusableElement | None
load(exception: Exception | None = None, when: str = '') None

Load dialog body & buttons.

show(**params: Any) None

Display and focuses the dialog.

title: AnyFormattedText | None = 'Error'
to_focus: FocusableElement | None
toggle() None

Show or hides the dialog.

class euporie.core.widgets.dialog.FileDialog(app: BaseApp)

Bases: euporie.core.widgets.dialog.Dialog

A base dialog to prompt the user for a file path.

body: AnyContainer
body_padding_bottom = 0
body_padding_top = 1
button_widgets: list[AnyContainer]
buttons: dict[str, Callable | None]
get_height() int | None
get_width() int | None
hide(event: KeyPressEvent | None = None) None

Hide the dialog.

last_focused: FocusableElement | None
load(text: str = '', tab: Tab | None = None, error: str = '', cb: Callable | None = None) None

Load the dialog body.

show(**params: Any) None

Display and focuses the dialog.

title: AnyFormattedText | None = 'Select a File'
to_focus: FocusableElement | None
toggle() None

Show or hides the dialog.

validate(buffer: Buffer, tab: Tab | None, cb: Callable | None = None) None

Validate the input.

class euporie.core.widgets.dialog.MsgBoxDialog(app: BaseApp)

Bases: euporie.core.widgets.dialog.Dialog

A dialog which shows the user a message.

body: AnyContainer
body_padding_bottom = 0
body_padding_top = 1
button_widgets: list[AnyContainer]
buttons: dict[str, Callable | None]
get_height() int | None
get_width() int | None
hide(event: KeyPressEvent | None = None) None

Hide the dialog.

last_focused: FocusableElement | None
load(title: str = 'Message', message: str = '') None

Load dialog body & buttons.

show(**params: Any) None

Display and focuses the dialog.

title: AnyFormattedText | None = 'Message'
to_focus: FocusableElement | None
toggle() None

Show or hides the dialog.

class euporie.core.widgets.dialog.NoKernelsDialog(app: BaseApp)

Bases: euporie.core.widgets.dialog.Dialog

Dialog to warn the user that no installed kernels were found.

body: AnyContainer
body_padding_bottom = 0
body_padding_top = 1
button_widgets: list[AnyContainer]
buttons: dict[str, Callable | None]
get_height() int | None
get_width() int | None
hide(event: KeyPressEvent | None = None) None

Hide the dialog.

last_focused: FocusableElement | None
load() None

Load the dialog body.

show(**params: Any) None

Display and focuses the dialog.

title: AnyFormattedText | None = 'No Kernels Found'
to_focus: FocusableElement | None
toggle() None

Show or hides the dialog.

class euporie.core.widgets.dialog.OpenFileDialog(app: BaseApp)

Bases: euporie.core.widgets.dialog.FileDialog

A dialog which prompts the user for a filepath to open.

body: AnyContainer
body_padding_bottom = 0
body_padding_top = 1
button_widgets: list[AnyContainer]
buttons: dict[str, Callable | None]
get_height() int | None
get_width() int | None
hide(event: KeyPressEvent | None = None) None

Hide the dialog.

last_focused: FocusableElement | None
load(text: str = '', tab: Tab | None = None, error: str = '', cb: Callable | None = None) None

Load the dialog body.

show(**params: Any) None

Display and focuses the dialog.

title: AnyFormattedText | None = 'Select a File to Open'
to_focus: FocusableElement | None
toggle() None

Show or hides the dialog.

validate(buffer: Buffer, tab: Tab | None, cb: Callable | None = None) None

Validate the the file to open exists.

class euporie.core.widgets.dialog.SaveAsDialog(app: BaseApp)

Bases: euporie.core.widgets.dialog.FileDialog

A dialog which prompts the user for a filepath to save the current tab.

body: AnyContainer
body_padding_bottom = 0
body_padding_top = 1
button_widgets: list[AnyContainer]
buttons: dict[str, Callable | None]
get_height() int | None
get_width() int | None
hide(event: KeyPressEvent | None = None) None

Hide the dialog.

last_focused: FocusableElement | None
load(text: str = '', tab: Tab | None = None, error: str = '', cb: Callable | None = None) None

Load the dialog body.

show(**params: Any) None

Display and focuses the dialog.

title: AnyFormattedText | None = 'Select a Path to Save'
to_focus: FocusableElement | None
toggle() None

Show or hides the dialog.

validate(buffer: Buffer, tab: Tab | None, cb: Callable | None = None) None

Validate the the file to open exists.

class euporie.core.widgets.dialog.SelectKernelDialog(app: BaseApp)

Bases: euporie.core.widgets.dialog.Dialog

A dialog which allows the user to select a kernel.

body: AnyContainer
body_padding_bottom = 0
body_padding_top = 1
button_widgets: list[AnyContainer]
buttons: dict[str, Callable | None]
get_height() int | None
get_width() int | None
hide(event: KeyPressEvent | None = None) None

Hide the dialog.

last_focused: FocusableElement | None
load(kernel_specs: dict[str, Any] | None = None, runtime_dirs: dict[str, Path] | None = None, tab: KernelTab | None = None, message: str = '') None

Load dialog body & buttons.

show(**params: Any) None

Display and focuses the dialog.

title: AnyFormattedText | None = 'Select Kernel'
to_focus: FocusableElement | None
toggle() None

Show or hides the dialog.

class euporie.core.widgets.dialog.ShortcutsDialog(app: BaseApp)

Bases: euporie.core.widgets.dialog.Dialog

Display details of registered key-bindings in a dialog.

body: AnyContainer
body_padding_bottom = 0
body_padding_top = 1
button_widgets: list[AnyContainer]
buttons: dict[str, Callable | None]
format_key_info() StyleAndTextTuples

Generate a table with the current key bindings.

get_height() int | None
get_width() int | None
hide(event: KeyPressEvent | None = None) None

Hide the dialog.

last_focused: FocusableElement | None
load(*args: Any, **kwargs: Any) None

Load the dialog body.

show(**params: Any) None

Display and focuses the dialog.

title: AnyFormattedText | None = 'Keyboard Shortcuts'
to_focus: FocusableElement | None
toggle() None

Show or hides the dialog.

class euporie.core.widgets.dialog.UnsavedDialog(app: BaseApp)

Bases: euporie.core.widgets.dialog.Dialog

A dialog prompting the user to save unsaved changes.

body: AnyContainer
body_padding_bottom = 0
body_padding_top = 1
button_widgets: list[AnyContainer]
buttons: dict[str, Callable | None]
get_height() int | None
get_width() int | None
hide(event: KeyPressEvent | None = None) None

Hide the dialog.

last_focused: FocusableElement | None
load(tab: Tab | None = None, cb: Callable[[], None] | None = None) None

Load the dialog body.

show(**params: Any) None

Display and focuses the dialog.

title: AnyFormattedText | None = 'Unsaved Changes'
to_focus: FocusableElement | None
toggle() None

Show or hides the dialog.