betty.cli module - Betty documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# betty.cli module

Provide the Command Line Interface.

class betty.cli.CommandProvider

  Bases: `object`

  Provide additional commands.

  property commands: dict[str, Command]

    The commands to provide.

betty.cli.app_command(f: Callable[[Concatenate[betty.app.App, P]], Awaitable[None]]) → Callable[[P], None]

  Decorate a command to receive the currently running `betty.app.App` as its first argument.

  Parameters:

    f (`typing.Callable`[[`typing.Concatenate`[`betty.app.App`, `typing.ParamSpec`(`P`, bound= `None`)]], `typing.Awaitable`[`None`]])

  Return type:

    `typing.Callable`[[`typing.ParamSpec`(`P`, bound= `None`)], `None`]

betty.cli.catch_exceptions() → Iterator[None]

  Catch and log all exceptions.

  Return type:

    `typing.Iterator`[`None`]

betty.cli.global_command(f: Callable[[P], Awaitable[None]]) → Callable[[P], None]

  Decorate a command to be global.

  Parameters:

    f (`typing.Callable`[[`typing.ParamSpec`(`P`, bound= `None`)], `typing.Awaitable`[`None`]])

  Return type:

    `typing.Callable`[[`typing.ParamSpec`(`P`, bound= `None`)], `None`]