Add a new Console object for console interactions.
Review Request #11409 — Created Jan. 26, 2021 and submitted
reviewboard.cmdline.utils.console.Console, which is a
new interface for outputting to the console. It takes care of wrapping
text to terminal widths, styling some content, and has functions for
outputting standard pieces of content to the console (such as
paragraphs, notes, warnings, errors, lists of items, and progress
This is the successor to the old
ConsoleUI, built to be more generic
and usable outside of a wizard setup.
ConsoleUIstill exists, but now
wraps this and will be phased out, since the multi-UI support hasn't
been needed in a long time, and much of its remaining page-based design
is no longer relevant.
Consoleinterface will be used for some parts of
for other command line helpers in the future.
Some styling has improved. The default terminal width is now wider at 79
characters. Itemized lists are no longer indented too far, and their
items now wrap correctly. Errors are no longer treated specially with
regards to their prefix vs. text placement (previously, we indented all
text to align with the placement of error text, after the
These changes should help keep console output a bit more consistent.
prepare-dev.pyboth appear more or less the
same as they did before.
Tested all of
prepare-dev.pywith Python 2.7, 3.6, and
3.9, at different terminal widths. Verified the results looked the way
F401 'reviewboard.cmdline.utils.console.ConsoleUI' imported but unused