betty.cli package

Module contents

Provide the Command Line Interface.

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

Catch and log all exceptions.

Return type:

typing.Iterator[None]

betty.cli.command(f: Callable[[_P], collections.abc.Coroutine[Any, Any, None]]) Callable[[_P], None][source]

Mark something a Betty command.

Parameters:

f (typing.Callable[[typing.ParamSpec(_P, bound= None)], collections.abc.Coroutine[typing.Any, typing.Any, None]])

Return type:

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

betty.cli.discover_commands() collections.abc.Mapping[str, click.core.Command][source]

Discover the available commands.

Return type:

collections.abc.Mapping[str, click.core.Command]

betty.cli.pass_app(f: Callable[[Concatenate[betty.app.App, _P]], None]) Callable[[_P], None][source]

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)]], None])

Return type:

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

betty.cli.pass_project(f: Callable[[Concatenate[betty.project.Project, _P]], None]) Callable[[_P], None][source]

Decorate a command to receive the currently running betty.project.Project as its first argument.

Parameters:

f (typing.Callable[[typing.Concatenate[betty.project.Project, typing.ParamSpec(_P, bound= None)]], None])

Return type:

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