From 76824fc369c57e50c533888807559a5f2382258a Mon Sep 17 00:00:00 2001 From: Sofie Van Landeghem Date: Thu, 29 Aug 2024 01:26:35 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20typo=20in=20function?= =?UTF-8?q?=20name=20`=5Fmake=5Frich=5Ftext`=20(#959)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typer/rich_utils.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/typer/rich_utils.py b/typer/rich_utils.py index 900f4b4e87..905c5a3dbf 100644 --- a/typer/rich_utils.py +++ b/typer/rich_utils.py @@ -144,7 +144,7 @@ def _get_rich_console(stderr: bool = False) -> Console: ) -def _make_rich_rext( +def _make_rich_text( *, text: str, style: str = "", markup_mode: MarkupMode ) -> Union[Markdown, Text]: """Take a string, remove indentations, and return styled text. @@ -194,7 +194,7 @@ def _get_help_text( # Remove single linebreaks if markup_mode != MARKUP_MODE_MARKDOWN and not first_line.startswith("\b"): first_line = first_line.replace("\n", " ") - yield _make_rich_rext( + yield _make_rich_text( text=first_line.strip(), style=STYLE_HELPTEXT_FIRST_LINE, markup_mode=markup_mode, @@ -217,7 +217,7 @@ def _get_help_text( # Join with double linebreaks if markdown remaining_lines = "\n\n".join(remaining_paragraphs) - yield _make_rich_rext( + yield _make_rich_text( text=remaining_lines, style=STYLE_HELPTEXT, markup_mode=markup_mode, @@ -272,7 +272,7 @@ def _get_parameter_help( for x in paragraphs ] items.append( - _make_rich_rext( + _make_rich_text( text="\n".join(paragraphs).strip(), style=STYLE_OPTION_HELP, markup_mode=markup_mode, @@ -331,7 +331,7 @@ def _make_command_help( paragraphs[0] = paragraphs[0].replace("\n", " ") elif paragraphs[0].startswith("\b"): paragraphs[0] = paragraphs[0].replace("\b\n", "") - return _make_rich_rext( + return _make_rich_text( text=paragraphs[0].strip(), style=STYLE_OPTION_HELP, markup_mode=markup_mode, @@ -674,7 +674,7 @@ def rich_format_help( # Remove single linebreaks, replace double with single lines = obj.epilog.split("\n\n") epilogue = "\n".join([x.replace("\n", " ").strip() for x in lines]) - epilogue_text = _make_rich_rext(text=epilogue, markup_mode=markup_mode) + epilogue_text = _make_rich_text(text=epilogue, markup_mode=markup_mode) console.print(Padding(Align(epilogue_text, pad=False), 1))