euporie.core.widgets.inputs

Define a cell object with input are and rich outputs, and related objects.

Functions

add_cmd(**kwargs)

Add a command to the centralized command system.

add_setting(name, default, help_, description)

Register a new config item.

get_app()

Get the current active (running) Application.

get_lexer_by_name(_alias, **options)

Return an instance of a Lexer subclass that has alias in its aliases list.

has_focus(value)

Enable when this buffer has the focus.

load_registered_bindings(*names[, config])

Assign key-bindings to commands based on a dictionary.

merge_key_bindings(bindings)

Merge multiple Keybinding objects together.

register_bindings(bindings)

Update the key-binding registry.

scrollable(window)

Return a filter which indicates if a window is scrollable.

to_filter(bool_or_filter)

Accept both booleans and Filters as input and turn it into a Filter.

Classes

AppendLineAutoSuggestion([style])

Append the auto suggestion to the current line of the input.

Condition(func)

Turn any callable into a Filter.

ConditionalAutoSuggestAsync(auto_suggest, filter)

Auto suggest that can be turned on and of according to a certain condition.

ConditionalContainer(content, filter)

Wrapper around any other container that can change the visibility.

ConditionalMargin(margin, filter)

Wrapper around other Margin classes to show/hide them.

ConditionalProcessor(processor, filter)

Processor that applies another processor, according to a certain condition. Example::.

DisplayMultipleCursors()

When we're in Vi block insert mode, display all the cursors.

DynamicLexer(get_lexer)

Lexer class that can dynamically returns any Lexer.

HighlightIncrementalSearchProcessor()

Highlight the search terms that are used for highlighting the incremental search.

HighlightMatchingBracketProcessor([chars, ...])

When the cursor is on or right after a bracket, it highlights the matching bracket.

HighlightSelectionProcessor()

Processor that highlights the selection in the document.

KernelInput(kernel_tab, *args[, ...])

Kernel input text areas.

NumberedDiffMargin()

Margin that displays the line numbers of a Window.

OverflowMargin()

A margin which indicates lines extending beyond the edge of the window.

PagerState(code, cursor_pos, response)

A named tuple which describes the state of a pager.

PygmentsLexer(pygments_lexer_cls[, ...])

Lexer that calls a pygments lexer.

ScrollbarMargin([display_arrows, ...])

Margin displaying a scrollbar.

ShowTrailingWhiteSpaceProcessor([char, style])

Make trailing whitespace visible.

SimpleLexer([style])

Lexer that doesn't do any tokenizing and returns the whole input as one token.

StdInput(kernel_tab)

A widget to accept kernel input.

TabsProcessor([tabstop, char1, char2, style])

Render tabs as spaces (instead of ^I) or make them visible (for instance, by replacing them with dots.)

TextArea([text, multiline, password, lexer, ...])

A simple input field.

Exceptions

ClassNotFound

Raised if one of the lookup functions didn't find a matching class.

class euporie.core.widgets.inputs.KernelInput(kernel_tab: KernelTab, *args: Any, left_margins: Sequence[Margin] | None = None, right_margins: Sequence[Margin] | None = None, on_text_changed: Callable[[Buffer], None] | None = None, on_cursor_position_changed: Callable[[Buffer], None] | None = None, tempfile_suffix: str | Callable[[], str] = '', key_bindings: KeyBindingsBase | None = None, enable_history_search: FilterOrBool | None = False, wrap_lines: FilterOrBool = False, complete_while_typing: FilterOrBool = True, autosuggest_while_typing: FilterOrBool = True, validate_while_typing: FilterOrBool | None = None, **kwargs: Any)

Bases: prompt_toolkit.widgets.base.TextArea

Kernel input text areas.

A customized text area for the cell input.

property accept_handler: Optional[Callable[[prompt_toolkit.buffer.Buffer], bool]]

The accept handler. Called when the user accepts the input.

property document: prompt_toolkit.document.Document

The Buffer document (text + cursor position).

inspect() None

Get contextual help for the current cursor position in the current cell.

property text: str

The Buffer text.

class euporie.core.widgets.inputs.StdInput(kernel_tab: KernelTab)

Bases: object

A widget to accept kernel input.

accept(buffer: Buffer) bool

Send the input to the kernel and hide the input box.

get_input(prompt: str = 'Please enter a value: ', password: bool = False) None

Prompt the user for input and sends the result to the kernel.