Skip to content

rich_click.rich_panel

Attributes

NameDescription
CTNo description.
ColTNo description.
GroupTypeNo description.

Classes

NameDescription
RichCommandPanelPanel of subcommands in the help output.
RichOptionPanelPanel of options and arguments in the help output.
RichPanelRichPanel base class.

Functions

NameDescription
construct_panelsConstruct panels from the command as well as from the old groups config.

CTattributemodule attribute#

CT = TypeVar('CT', Command, Parameter)

ColTattributemodule attribute#

ColT = TypeVar('ColT', bound=ColumnType)

GroupTypeattributemodule attribute#

GroupType = TypeVar('GroupType', OptionGroupDict, CommandGroupDict)

RichCommandPanelclass#

class RichCommandPanel(name: str, commands: list[str] | None = None, **kwargs: Any)

Bases: RichPanel[Command, CommandColumnType]

Panel of subcommands in the help output.

Initialize a RichCommandPanel.

commandsattributeinstance attribute#

commands = commands or []

get_objectsmethod#

def get_objects(command: Command, ctx: Context) -> Generator[Command, None, None]

List the objects assigned to the panel.

get_tablemethod#

def get_table(command: RichCommand, ctx: RichContext, formatter: RichHelpFormatter) -> Table

list_all_objectsmethodclassmethod#

def list_all_objects(ctx: Context) -> list[tuple[str, Command]]

rendermethod#

def render(command: RichCommand, ctx: RichContext, formatter: RichHelpFormatter) -> Panel

RichOptionPanelclass#

class RichOptionPanel(name: str, options: list[str] | None = None, **kwargs: Any)

Bases: RichPanel[Parameter, OptionColumnType]

Panel of options and arguments in the help output.

Initialize a RichOptionPanel.

optionsattributeinstance attribute#

options = options or []

get_objectsmethod#

def get_objects(command: Command, ctx: Context) -> Generator[Parameter, None, None]

List the objects assigned to the panel.

get_tablemethod#

def get_table(command: RichCommand, ctx: RichContext, formatter: RichHelpFormatter) -> Table

list_all_objectsmethodclassmethod#

def list_all_objects(ctx: Context) -> list[tuple[str, Parameter]]

rendermethod#

def render(command: RichCommand, ctx: RichContext, formatter: RichHelpFormatter) -> Panel

RichPanelclass#

class RichPanel(name: str, *, help: str | None = None, help_style: StyleType | None = None, table_styles: dict[str, Any] | None = None, panel_styles: dict[str, Any] | None = None, column_types: list[ColT] | None = None, inline_help_in_title: bool | None = None, title_style: StyleType | None = None)

Bases: Generic[CT, ColT]

RichPanel base class.

Initialize a RichPanel.

column_typesattributeinstance attribute#

column_types = column_types

helpattributeinstance attribute#

help = help

help_styleattributeinstance attribute#

help_style = help_style

inline_help_in_titleattributeinstance attribute#

inline_help_in_title = inline_help_in_title

nameattributeinstance attribute#

name = name

panel_classattributeclass attributeinstance attribute#

panel_class: type[Panel] | None = None

panel_stylesattributeinstance attribute#

panel_styles = panel_styles or {}

table_classattributeclass attributeinstance attribute#

table_class: type[Table] | None = None

table_stylesattributeinstance attribute#

table_styles = table_styles or {}

title_styleattributeinstance attribute#

title_style = title_style

objectsproperty#

objects: list[str]

add_objectmethod#

def add_object(o: str) -> None

get_boxmethod#

def get_box(box: str | Box | None) -> Box | None

get_objectsmethod#

def get_objects(command: Command, ctx: Context) -> Generator[CT, None, None]

List the proper names assigned to the panel.

get_tablemethod#

def get_table(command: RichCommand, ctx: RichContext, formatter: RichHelpFormatter) -> Table

list_all_objectsmethodclassmethod#

def list_all_objects(ctx: Context) -> list[tuple[str, CT]]

List all objects of the command that this panel type works with.

rendermethod#

def render(command: RichCommand, ctx: RichContext, formatter: RichHelpFormatter) -> Panel

to_info_dictmethod#

def to_info_dict(ctx: Context) -> dict[str, Any]

construct_panelsfunction#

def construct_panels(command: RichCommand, ctx: RichContext, formatter: RichHelpFormatter) -> list[RichPanel[Any, Any]]

Construct panels from the command as well as from the old groups config.