Add color output and visual hints to rb-site and prepare-dev.py.

Review Request #11165 — Created Sept. 8, 2020 and submitted

Information

Review Board
release-4.0.x

Reviewers

Both rb-site and prepare-dev.py deal with a lot of text, and it can kind
of blend together, particularly as operations are being performed
(database synchronization, for instance).

To help distinguish parts of the setup, we now display color output for
headers, prompts, errors, notices, and success indicators.

Headers also have a visual separator, making it very clear what section
some content is in. This replaces the simple asterisk that previously
proceeded a section title.

Color is only enabled if the terminal supports it (piggybacking on the
color support for Django management commands). --no-color can also be
provided to disable color.

Text content will also now fit the width of the terminal when run on
Python 3.x, which helps with cutting off content prematurely. This makes
use of shutil.get_terminal_size(), which is a standard way of returning
terminal dimensions.

Created a new site. Checked that all color output was as expected.

Set up a new dev tree. Verified the color output there as well.

Summary ID
Add color output and visual hints to rb-site and prepare-dev.py.
Both rb-site and prepare-dev.py deal with a lot of text, and it can kind of blend together, particularly as operations are being performed (database synchronization, for instance). To help distinguish parts of the setup, we now display color output for headers, prompts, errors, notices, and success indicators. Headers also have a visual separator, making it very clear what section some content is in. This replaces the simple asterisk that previously proceeded a section title. Color is only enabled if the terminal supports it (piggybacking on the color support for Django management commands). `--no-color` can also be provided to disable color.
ca22c62ab0487e27548fb2091c2a64aa5e7caa97

Description From Last Updated

F401 'django.core.management.color.make_style' imported but unused

reviewbotreviewbot

E731 do not assign a lambda expression, use a def

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-4.0.x (7139a7a)