OutputWrapper class to Commands which outputs to stream object of choice
Review Request #11401 — Created Jan. 23, 2021 and submitted — Latest diff uploaded
RBTools commands were previously using
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 forOutputWrapper
and another test that makes
sureOutputWrapper
passes the correct message to the output stream object
Diff Revision 15
This is not the most recent revision of the diff. The latest diff is revision 16. See what's changed.
Commits
rbtools/commands/__init__.py |
---|
rbtools/commands/tests/test_main.py |
---|