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 12 and 13

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
Added new test for OutputWrapper than ensures it passes a new line character ...
f137a9331459e3d88d9cb96f3e499730c6adcb30 Ryan Kang
Fixed inconsistency of the use of new_line(). Replaced self.stdout.write(n) w...
70cfb2c6f67be4b3f10af316835aae37488328e4 Ryan Kang
Fixed white space error at the end of rbtools/commands/__init__.py
91baf8a9e9f2e4d8c9b30a19c76d72b0860849b9 Ryan Kang
changed print statements in __init__.py to use output wrapper
7d65b3e5683ebcc7b9e0920146a7bf0b20bd28a9 Ryan Kang
fixed Review Bot issues where lines where over 80 characters in __init__.py
43788831f5c440ae0832f705ce943535f8d1936f Ryan Kang
moved OutputWrapper tests from __init__.py to test_main.py and renamed test c...
d8a51ac5c9d2315030b6c514177fc089ab9da020 Ryan Kang
fixed indentation and misspelled words issues in test_main.py:OutputWrapper
5b2937ea7acf8e4e602f03abdd97dde2ebaae997 Ryan Kang
moved OutputWrapper tests to test_main.py and imported KGB
ef64e449e9026ac8a171ef712a8295b30a90a88c Ryan Kang
Added docstrings for OutputWrapper methods
changed stdout_byte to stdout_bytes and stderr_byte to stderr_bytes in Command __init__ String styling changes to properly align tabs and to ensure spaces go on end of strings Changed importing kgb SpyAgency to import kgb Added spacing where needed and alphabetical ordering of test_main.py imports Improved description of OutputWrapperTests in test_main.py
c25d2df4c21dd1da9a1f6f9df6dbdc483ec5bea1 Ryan Kang
Changed docstrings to follow Review Board documentation guide.
Spacing issues between statements fixed Added attributes to Command docstring that summarizes attributes defined in its __init__ Refactored patch.py outputting of byte strings to use self.stdout_bytes properly Indentation issues from lint checkers fixed Fixed docstrings of OutputWrapperTests in test_main.py to format correctly with documentation
86196002cfc2c374c4cfa56123fd63da123e657f Ryan Kang
Fixed multiple blank lines with indentation problems
Fixed lines which exceeded 80 characters Fixed overindentation in setup_repo.py
b7f620e9317c269ef71f3288f6747b02088533f1 Ryan Kang
rbtools/commands/__init__.py
rbtools/commands/setup_repo.py
Loading...