|
126 | 126 | )
|
127 | 127 | from .utils import (
|
128 | 128 | _command_context,
|
129 |
| - _load_command_extensions, |
| 129 | + _load_command_plugins, |
130 | 130 | called_from_command_definition,
|
131 | 131 | called_from_module,
|
132 | 132 | get_usage_script,
|
@@ -861,6 +861,50 @@ class Typer(typer.Typer, t.Generic[P, R], metaclass=AppFactory):
|
861 | 861 | Typer_ apps. This class extends the ``typer.Typer`` class so that we can add
|
862 | 862 | the additional information necessary to attach this app to the root app
|
863 | 863 | and other groups specified on the django command.
|
| 864 | +
|
| 865 | + :param name: the name of the class being created |
| 866 | + :param bases: the base classes of the class being created |
| 867 | + :param attrs: the attributes of the class being created |
| 868 | + :param cls: The class to use as the core typer group wrapper |
| 869 | + :param invoke_without_command: whether to invoke the group callback if no command |
| 870 | + was specified. |
| 871 | + :param no_args_is_help: whether to show the help if no arguments are provided |
| 872 | + :param subcommand_metavar: the metavar to use for subcommands in the help output |
| 873 | + :param chain: whether to chain commands, this allows multiple commands from the group |
| 874 | + to be specified and run in order sequentially in one call from the command line. |
| 875 | + :param result_callback: a callback to invoke with the result of the command |
| 876 | + :param context_settings: the click context settings to use - see |
| 877 | + `click docs <https://click.palletsprojects.com/api/#context>`_. |
| 878 | + :param help: the help string to use, defaults to the function docstring, if you need |
| 879 | + to translate the help you should use the help kwarg instead because docstrings |
| 880 | + will not be translated. |
| 881 | + :param epilog: the epilog to use in the help output |
| 882 | + :param short_help: the short help to use in the help output |
| 883 | + :param options_metavar: the metavar to use for options in the help output |
| 884 | + :param add_help_option: whether to add the help option to the command |
| 885 | + :param hidden: whether to hide this group from the help output |
| 886 | + :param deprecated: show a deprecation warning |
| 887 | + :param rich_markup_mode: the rich markup mode to use - if rich is installed |
| 888 | + this can be used to enable rich markup or Markdown in the help output. Can |
| 889 | + be "markdown", "rich" or None to disable markup rendering. |
| 890 | + :param rich_help_panel: the rich help panel to use - if rich is installed |
| 891 | + this can be used to group commands into panels in the help output. |
| 892 | + :param pretty_exceptions_enable: whether to enable pretty exceptions - if rich is |
| 893 | + installed this can be used to enable pretty exception rendering. This will |
| 894 | + default to on if the traceback configuration settings installs the rich |
| 895 | + traceback handler. This allows tracebacks to be configured by the user on a |
| 896 | + per deployment basis in the settings file. We therefore do not advise |
| 897 | + hardcoding this value. |
| 898 | + :param pretty_exceptions_show_locals: whether to show local variables in pretty |
| 899 | + exceptions - if rich is installed. This will default to the 'show_locals' |
| 900 | + setting in the traceback configuration setting (on by default). This allows |
| 901 | + tracebacks to be configured by the user on a per deployment basis in the |
| 902 | + settings file. We therefore do not advise hardcoding this value. |
| 903 | + :param pretty_exceptions_short: whether to show short tracebacks in pretty |
| 904 | + exceptions - if rich is installed. This will default to the 'short' setting |
| 905 | + in the traceback configuration setting (off by default). This allows tracebacks |
| 906 | + to be configured by the user on a per deployment basis in the settings file. We |
| 907 | + therefore do not advise hardcoding this value. |
864 | 908 | """
|
865 | 909 |
|
866 | 910 | parent: t.Optional["Typer"] = None
|
@@ -1727,12 +1771,9 @@ def _resolve_help(dj_cmd: "TyperCommand"):
|
1727 | 1771 | """
|
1728 | 1772 | hlp = None
|
1729 | 1773 | for cmd_cls in [
|
1730 |
| - dj_cmd.__class__, |
1731 |
| - *[ |
1732 |
| - c |
1733 |
| - for c in dj_cmd.__class__.__mro__ |
1734 |
| - if issubclass(c, TyperCommand) and c is not TyperCommand |
1735 |
| - ], |
| 1774 | + c |
| 1775 | + for c in dj_cmd.__class__.__mro__ |
| 1776 | + if issubclass(c, TyperCommand) and c is not TyperCommand |
1736 | 1777 | ]:
|
1737 | 1778 | hlp = cmd_cls.__doc__
|
1738 | 1779 | if hlp:
|
@@ -2896,7 +2937,7 @@ def __init__(
|
2896 | 2937 | **kwargs,
|
2897 | 2938 | ):
|
2898 | 2939 | assert self.typer_app.info.name
|
2899 |
| - _load_command_extensions(self.typer_app.info.name) |
| 2940 | + _load_command_plugins(self.typer_app.info.name) |
2900 | 2941 | _add_common_initializer(self)
|
2901 | 2942 | _resolve_help(self)
|
2902 | 2943 |
|
|
0 commit comments