OutputWrapper class to Commands which outputs to stream object of choice

Review Request #11401 — Created Jan. 23, 2021 and submitted — Latest diff uploaded

Information

RBTools
master

Reviewers

RBTools commands were previously using print and sys.stderr
to output messages. This change abstracting outputting by using a
wrapper around a stream output object. This makes it easier to customize
output streams and suppress output. 4 wrappers (2 for standard output
unicode and byte, 2 for standard error unicode and byte) are initiated
in the Command class that is accessible to all child classes.

Ran all tests in ./tests/runtests.py rbtools.commands and passed.

Added two new tests for __init__.py. One that tests if output stream
object is set correctly for OutputWrapper and another test that makes
sure OutputWrapper passes the correct message to the output stream object

Changes between revision 2 and 3

orig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

Commits

Summary ID Author
added OutputWrapper class to Commands which outputs to stream object of choic...
ca88dd1ff65187e387fdf17dc19f4c0c89fb903c Ryan Kang
replaced all of the prints with output wrapper and initiated wrapper in Comma...
e31adcfce9cf6cdbc5272a57a81cb0c7acdd7c5b Ryan Kang
Fixed all of the Review Bot string formatting issues and fixed consistency is...
360b92a955667e881394ee9f8a482d397bf176e6 Ryan Kang
Fixed Review Bot issues on trailing white spaces, indentation, whitespace aft...
0e77eec5effa3e23f3d13fb7578f2ef22037f413 Ryan Kang
rbtools/commands/__init__.py
rbtools/commands/land.py
rbtools/commands/setup_repo.py
rbtools/commands/status_update.py
rbtools/commands/tests/__init__.py
Loading...