euporie.core.filters

Define common filters.

Module Attributes

insert_mode

Determine if any binding style is in replace mode.

Functions

cache(user_function, /)

Simple lightweight unbounded cache.

char_after_cursor(char)

Generate a condition to check for a character after the cursor.

command_exists(*cmds)

Verify a list of external commands exist on the system.

find_spec(name[, package])

Return the spec for the specified module.

have_modules(*modules)

Verify a list of python modules are importable.

reduce(function, iterable[, initial], /)

Apply a function of two arguments cumulatively to the items of a sequence or iterable, from left to right, so as to reduce the iterable to a single value.

scrollable(window)

Return a filter which indicates if a window is scrollable.

tab_type_has_focus(tab_class_path)

Determine if the focused tab is of a particular type.

to_filter(bool_or_filter)

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

which(cmd[, mode, path])

Given a command, mode, and a PATH string, return the path which conforms to the given mode on the PATH, or None if there is no such file.

Classes

Condition(func)

Turn any callable into a Filter.

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

Enum to define edit mode state types.

partial(func, /, *args, **keywords)

Create a new function with partial application of the given arguments and keywords.

euporie.core.filters.char_after_cursor(char: str) Condition

Generate a condition to check for a character after the cursor.

euporie.core.filters.command_exists(*cmds: str) Filter

Verify a list of external commands exist on the system.

euporie.core.filters.have_modules(*modules: str) Filter

Verify a list of python modules are importable.

euporie.core.filters.insert_mode = Condition(<function vi_mode>)&Condition(<function vi_insert_mode>)|Condition(<function emacs_mode>)&Condition(<function emacs_insert_mode>)|Condition(<function micro_mode>)&Condition(<function micro_insert_mode>)

Determine if any binding style is in replace mode.

euporie.core.filters.scrollable(window: Window) Filter

Return a filter which indicates if a window is scrollable.

euporie.core.filters.tab_type_has_focus(tab_class_path: str) Condition

Determine if the focused tab is of a particular type.