betty.cli.commands package¶
Submodules¶
- betty.cli.commands.clear_caches module
- betty.cli.commands.config module
- betty.cli.commands.demo module
- betty.cli.commands.dev_new_translation module
- betty.cli.commands.dev_update_translations module
- betty.cli.commands.docs module
- betty.cli.commands.extension_new_translation module
- betty.cli.commands.extension_update_translations module
- betty.cli.commands.generate module
- betty.cli.commands.new module
- betty.cli.commands.new_translation module
- betty.cli.commands.serve module
- betty.cli.commands.update_translations module
Module contents¶
Provide the Command Line Interface.
- betty.cli.commands.COMMAND_REPOSITORY: PluginRepository[Command] = <betty.cli.commands._CommandRepository object>¶
The Command Line Interface command repository.
Read more about CLI command plugins.
- class betty.cli.commands.Command[source]¶
Bases:
Plugin
Define a CLI command plugin.
Read more about CLI command plugins.
- classmethod plugin_description() Localizable | None [source]¶
Get the human-readable long plugin description.
- classmethod plugin_id() MachineName [source]¶
Get the plugin ID.
IDs are unique per plugin type:
A plugin repository MUST at most have a single plugin for any ID.
Different plugin repositories MAY each have a plugin with the same ID.
- classmethod plugin_label() Localizable [source]¶
Get the human-readable short plugin label.
- betty.cli.commands.command(name: Callable[..., Coroutine[Any, Any, Any]]) BettyCommand [source]¶
- betty.cli.commands.command(name: str | None, cls: type[_BettyCommandT], **attrs: Any) Callable[[Callable[..., Coroutine[Any, Any, Any]]], _BettyCommandT]
- betty.cli.commands.command(name: None = None, *, cls: type[_BettyCommandT], **attrs: Any) Callable[[Callable[..., Coroutine[Any, Any, Any]]], _BettyCommandT]
- betty.cli.commands.command(name: str | None = None, cls: None = None, **attrs: Any) Callable[[Callable[..., Coroutine[Any, Any, Any]]], BettyCommand]
Mark something a Betty command.
This is almost identical to
click.command()
, except thatcls
must extendbetty.cli.commands.BettyCommand
.Functions decorated with
@command
may choose to raisebetty.error.UserFacingError
, which will automatically be localized and reraised asclick.ClickException
.Read more about CLI command plugins.
- betty.cli.commands.parameter_callback(f: Callable[Concatenate[_T, _P], _ReturnT], *args: _P.args, **kwargs: _P.kwargs) Callable[[Context, Parameter, _T], _ReturnT] [source]¶
Convert a callback that takes a parameter (option, argument) value and returns it after processing.
This handles errors so Click can gracefully exit.
- betty.cli.commands.pass_app(f: Callable[Concatenate[App, _P], _ReturnT]) Callable[_P, _ReturnT] [source]¶
Decorate a command to receive the currently running
betty.app.App
as its first argument.
- betty.cli.commands.pass_project(f: Callable[Concatenate[Project, _P], _ReturnT]) Callable[_P, _ReturnT] [source]¶
Decorate a command to receive the currently running
betty.project.Project
as its first argument.