rich_click.rich_panel
Classes
| Name | Description |
|---|---|
RichCommandPanel | Panel of subcommands in the help output. |
RichOptionPanel | Panel of options and arguments in the help output. |
RichPanel | RichPanel base class. |
Functions
| Name | Description |
|---|---|
construct_panels | Construct 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.
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) -> Tablelist_all_objectsmethodclassmethod#
def list_all_objects(ctx: Context) -> list[tuple[str, Command]]rendermethod#
def render(command: RichCommand, ctx: RichContext, formatter: RichHelpFormatter) -> PanelRichOptionPanelclass#
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.
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) -> Tablelist_all_objectsmethodclassmethod#
def list_all_objects(ctx: Context) -> list[tuple[str, Parameter]]rendermethod#
def render(command: RichCommand, ctx: RichContext, formatter: RichHelpFormatter) -> PanelRichPanelclass#
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)RichPanel base class.
Initialize a RichPanel.
column_typesattributeinstance attribute#
column_types = column_typeshelpattributeinstance attribute#
help = helphelp_styleattributeinstance attribute#
help_style = help_styleinline_help_in_titleattributeinstance attribute#
inline_help_in_title = inline_help_in_titlenameattributeinstance attribute#
name = namepanel_classattributeclass attributeinstance attribute#
panel_class: type[Panel] | None = Nonepanel_stylesattributeinstance attribute#
panel_styles = panel_styles or {}table_classattributeclass attributeinstance attribute#
table_class: type[Table] | None = Nonetable_stylesattributeinstance attribute#
table_styles = table_styles or {}title_styleattributeinstance attribute#
title_style = title_styleadd_objectmethod#
def add_object(o: str) -> Noneget_boxmethod#
def get_box(box: str | Box | None) -> Box | Noneget_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) -> Tablelist_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) -> Panelto_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.