LoaderCLI#

class lsst.daf.butler.cli.butler.LoaderCLI(*args: Any, **kwargs: Any)#

Bases: Group, ABC

Extends click.MultiCommand, which dispatches to subcommands, to load subcommands at runtime.

Parameters#

*argstyping.Any

Arguments passed to parent constructor.

**kwargstyping.Any

Keyword arguments passed to parent constructor.

Attributes Summary

localCmdPkg

Identifies the location of the commands that are in this package.

Methods Summary

getLocalCommands()

Get the commands offered by the local package.

getPluginList()

Get the list of importable yaml files that contain cli data for this command.

get_command(ctx, name)

Get a single command for execution.

list_commands(ctx)

Get all the commands that can be called by the butler command, it is used to generate the --help output.

Attributes Documentation

localCmdPkg#

Identifies the location of the commands that are in this package.

getLocalCommands assumes that the commands can be found in localCmdPkg.__all__, if this is not the case then getLocalCommands should be overridden.

Returns#

packagestr

The fully qualified location of this package.

Methods Documentation

getLocalCommands() defaultdict[str, list[str | PluginCommand]]#

Get the commands offered by the local package. This assumes that the commands can be found in localCmdPkg.__all__, if this is not the case then this function should be overridden.

Returns#

commandsdefaultdict [str, list [str | PluginCommand ]]

The key is the command name. The value is a list of package(s) that contains the command.

classmethod getPluginList() list[ResourcePath]#

Get the list of importable yaml files that contain cli data for this command.

Returns#

list [lsst.resources.ResourcePath]

The list of files that contain yaml data about a cli plugin.

get_command(ctx: Context, name: str) Command | None#

Get a single command for execution.

Used by Click.

Parameters#

ctxclick.Context

The current Click context.

namestr

The name of the command to return.

Returns#

commandclick.Command

A Command that wraps a callable command function.

list_commands(ctx: Context) list[str]#

Get all the commands that can be called by the butler command, it is used to generate the –help output.

Used by Click.

Parameters#

ctxclick.Context

The current Click context.

Returns#

commandslist [str]

The names of the commands that can be called by the butler command.