betty.cli module

Provide the Command Line Interface.

class betty.cli.CommandProvider[source]

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][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)]], typing.Awaitable[None]])

Return type:

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

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

Catch and log all exceptions.

Return type:

typing.Iterator[None]

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

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]