euporie.core.commands
Define a command object for use in key-bindings, menus, and the command palette.
Functions
|
Add a command to the centralized command system. |
|
Cast a value to a type. |
|
Get the current active (running) Application. |
|
Get a command from the centralized command system by name. |
|
Return true if object can be passed to an |
|
Return true if the object is a coroutine function. |
|
Pare a list of keys. |
|
Get a signature object for the passed callable. |
|
Accept both booleans and Filters as input and turn it into a Filter. |
Classes
|
Key binding: (key sequence + handler + filter). |
|
Wrap a function so it can be used as a key-binding or a menu item. |
|
Key press event, delivered to key bindings. |
- class euporie.core.commands.Command(handler: CommandHandler, *, filter: FilterOrBool = True, hidden: FilterOrBool = False, name: str | None = None, aliases: list[str] | None = None, title: str | None = None, menu_title: str | None = None, description: str | None = None, toggled: Filter | None = None, eager: FilterOrBool = False, is_global: FilterOrBool = False, save_before: Callable[[KeyPressEvent], bool] = <function Command.<lambda>>, record_in_macro: FilterOrBool = True)
Bases:
object
Wrap a function so it can be used as a key-binding or a menu item.
- bind(key_bindings: KeyBindingsBase, keys: AnyKeys) None
Add the current commands to a set of key bindings.
- Parameters:
key_bindings – The set of key bindings to bind to
keys – Additional keys to bind to the command
- property key_handler: KeyHandlerCallable
Return a key handler for the command.
Return a menu item for the command.