From ce4d25f3cd0a1c6e65b64015140fb5e1397c8ac5 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Sun, 2 Jan 2022 21:33:20 +0300 Subject: bpo-46196: document method cmd.Cmd.columnize (#30303) The method is already written and tested, now it's officially public. --- Doc/library/cmd.rst | 7 +++++++ .../next/Documentation/2021-12-30-19-12-24.bpo-46196.UvQ8Sq.rst | 1 + 2 files changed, 8 insertions(+) create mode 100644 Misc/NEWS.d/next/Documentation/2021-12-30-19-12-24.bpo-46196.UvQ8Sq.rst diff --git a/Doc/library/cmd.rst b/Doc/library/cmd.rst index d57edb7..fd5df96 100644 --- a/Doc/library/cmd.rst +++ b/Doc/library/cmd.rst @@ -121,6 +121,13 @@ A :class:`Cmd` instance has the following methods: :meth:`complete_\*` method is available. By default, it returns an empty list. +.. method:: Cmd.columnize(list, displaywidth=80) + + Method called to display a list of strings as a compact set of columns. + Each column is only as wide as necessary. + Columns are separated by two spaces for readability. + + .. method:: Cmd.precmd(line) Hook method executed just before the command line *line* is interpreted, but diff --git a/Misc/NEWS.d/next/Documentation/2021-12-30-19-12-24.bpo-46196.UvQ8Sq.rst b/Misc/NEWS.d/next/Documentation/2021-12-30-19-12-24.bpo-46196.UvQ8Sq.rst new file mode 100644 index 0000000..f14ada6 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2021-12-30-19-12-24.bpo-46196.UvQ8Sq.rst @@ -0,0 +1 @@ +Document method :meth:`cmd.Cmd.columnize`. -- cgit v0.12