Skip to content

Commit 2b30019

Browse files
committed
Rename FlexiHelpFormatter->ParagraphHelpFormatter
1 parent 8619282 commit 2b30019

File tree

4 files changed

+18
-17
lines changed

4 files changed

+18
-17
lines changed

Doc/library/argparse.rst

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -297,17 +297,17 @@ formatter_class
297297
^^^^^^^^^^^^^^^
298298

299299
:class:`ArgumentParser` objects allow the help formatting to be customized by
300-
specifying an alternate formatting class. Currently, there are four such
300+
specifying an alternate formatting class. Currently, there are five such
301301
classes:
302302

303303
.. class:: RawDescriptionHelpFormatter
304304
RawTextHelpFormatter
305-
FlexiHelpFormatter
305+
ParagraphHelpFormatter
306306
ArgumentDefaultsHelpFormatter
307307
MetavarTypeHelpFormatter
308308

309309
:class:`RawDescriptionHelpFormatter`, :class:`RawTextHelpFormatter`, and
310-
:class:`FlexiHelpFormatter` give more control over how textual descriptions
310+
:class:`ParagraphHelpFormatter` give more control over how textual descriptions
311311
are displayed.
312312
By default, :class:`ArgumentParser` objects line-wrap the description_ and
313313
epilog_ texts in command-line help messages::
@@ -363,16 +363,17 @@ including argument descriptions. However, multiple newlines are replaced with
363363
one. If you wish to preserve multiple blank lines, add spaces between the
364364
newlines.
365365

366-
:class:`FlexiHelpFormatter` wraps description and help text like the default
367-
formatter, while preserving paragraphs and supporting bulleted lists. Bullet
368-
list items are recognized by markers such as "*", "-", "+", or ">" characters, or
369-
by alphanumeric sequences followed by "." or ")" (e.g. 1., a), iv.)::
366+
:class:`ParagraphHelpFormatter` wraps description and help text like the
367+
default formatter, while preserving paragraphs and supporting bulleted lists.
368+
Bullet list items are recognized by markers such as "*", "-", "+", or ">"
369+
characters, or by alphanumeric sequences followed by "." or ")" (e.g. 1., a),
370+
iv.)::
370371

371372
>>> parser = argparse.ArgumentParser(
372373
... prog='PROG',
373-
... formatter_class=argparse.FlexiHelpFormatter,
374+
... formatter_class=argparse.ParagraphHelpFormatter,
374375
... description="""
375-
... The FlexiHelpFormatter will wrap text within paragraphs
376+
... The ParagraphHelpFormatter will wrap text within paragraphs
376377
... when required to in order to make the text fit.
377378
...
378379
... Paragraphs are preserved.
@@ -392,7 +393,7 @@ by alphanumeric sequences followed by "." or ")" (e.g. 1., a), iv.)::
392393
>>> parser.print_help()
393394
usage: PROG [-h] argument
394395

395-
The FlexiHelpFormatter will wrap text within paragraphs when required to in
396+
The ParagraphHelpFormatter will wrap text within paragraphs when required to in
396397
order to make the text fit.
397398

398399
Paragraphs are preserved.
@@ -412,7 +413,7 @@ by alphanumeric sequences followed by "." or ")" (e.g. 1., a), iv.)::
412413

413414

414415
.. versionadded:: 3.15
415-
:class:`FlexiHelpFormatter` class was added.
416+
:class:`ParagraphHelpFormatter` class was added.
416417

417418
:class:`ArgumentDefaultsHelpFormatter` automatically adds information about
418419
default values to each of the argument help messages::

Lib/argparse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
'ArgumentDefaultsHelpFormatter',
7575
'RawDescriptionHelpFormatter',
7676
'RawTextHelpFormatter',
77-
'FlexiHelpFormatter',
77+
'ParagraphHelpFormatter',
7878
'MetavarTypeHelpFormatter',
7979
'Namespace',
8080
'Action',
@@ -754,7 +754,7 @@ def _split_lines(self, text, width):
754754
return text.splitlines()
755755

756756

757-
class FlexiHelpFormatter(HelpFormatter):
757+
class ParagraphHelpFormatter(HelpFormatter):
758758
"""Help message formatter which respects paragraphs and bulleted lists.
759759
760760
Only the name of this class is considered a public API. All the methods

Lib/test/test_argparse.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5409,11 +5409,11 @@ class TestHelpRawDescription(HelpTestCase):
54095409
version = ''
54105410

54115411

5412-
class TestHelpFlexi(HelpTestCase):
5413-
"""Test the FlexiHelpFormatter"""
5412+
class TestHelpParagraph(HelpTestCase):
5413+
"""Test the ParagraphHelpFormatter"""
54145414

54155415
parser_signature = Sig(
5416-
prog='PROG', formatter_class=argparse.FlexiHelpFormatter,
5416+
prog='PROG', formatter_class=argparse.ParagraphHelpFormatter,
54175417
description='This text should be wrapped as appropriate to keep\n'
54185418
'things nice and very, very tidy.\n'
54195419
'\n'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
The :mod:`argparse` module has a new :class:`argparse.FlexiHelpFormatter`
1+
The :mod:`argparse` module has a new :class:`argparse.ParagraphHelpFormatter`
22
class that wraps help and description text while preserving paragraphs and
33
supporting bulleted lists.

0 commit comments

Comments
 (0)