JBrowser Source Docs
You are reading the documentation for JBrowser 1.5.1. The newest release is 1.5.4. Go to the latest documentation

jbrowser.core.commands

Generated from the source code of JBrowser 1.5.1.

jbrowser/core/commands.py · 87 lines

Command registry: single source of truth for actions, shortcuts and the cheat sheet.

Command#

class Commandsource

Attributes

Name Value
id str
title str
category str
handler Callable[[], None]
shortcuts list[str] = field(default_factory=list)
keywords str = ''
icon str = ''
palette bool = True
state Callable[[], str | None] | None = None
enabled Callable[[], bool] | None = None

Command.shortcut_text#

shortcut_text() -> strsource

CommandRegistry#

class CommandRegistry(QObject)source
CommandRegistry(parent: QObject | None=None)

Signals

Signal Arguments
executed (str)

CommandRegistry.register#

register(cmd: Command) -> Commandsource

CommandRegistry.add#

add(id: str, title: str, category: str, handler: Callable[[], None], **kw) -> Commandsource

CommandRegistry.get#

get(id: str) -> Command | Nonesource

CommandRegistry.all#

all() -> list[Command]source

CommandRegistry.run#

run(id: str) -> Nonesource

CommandRegistry.install_shortcuts#

install_shortcuts(window: QWidget) -> Nonesource

CommandRegistry.set_shortcuts_enabled#

set_shortcuts_enabled(enabled: bool) -> Nonesource

Used while a full-window experience (the welcome tour) owns the keyboard.

CommandRegistry.categories#

categories() -> dict[str, list[Command]]source