JSON wrapper which inputs to a dictionary and outputs a JSON object

Review Request #11521 — Created March 20, 2021 and submitted — Latest diff uploaded

Information

RBTools
master

Reviewers

JSON wrapper class which inputs to a dictionary and outputs a JSON object. Class
is defined in rbtools/commands/__init__.py Command class. New command --json
added to global options, which can be added to any command. When --json is active
run_from_argv will print the json object using Python's json library.

For a full list of proposed JSON objects for each command see:
https://www.notion.so/reviewboard/a8cd6ee32806415fb7bba484d630863e?v=25fb1c9182064421ab17e55606da765b

Passed all tests in Command. Added new tests in test_main.py for initializing
wrapper, adding key value pairs to dictionary, getting correct JSON string from
dictionary, and printing to output stream with correct JSON string.

Diff Revision 1

This is not the most recent revision of the diff. The latest diff is revision 13. See what's changed.

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

Commits

First Last Summary ID Author
added JSON wrapper class to main.py which inputs to a dictionary and outputs ...
9bfcd1b986f5b42603b0809c7d78b638f6cee848 Ryan Kang
added new method to print JSON to stream object and tests to ensure it works ...
fbd48ac58a17e2f8d9feb7a219f66d061eed989c Ryan Kang
added new global command --json
9cf5b3f5bb931691494dfb7922a5a0c910ea8a2d Ryan Kang
added conditional at the end of command cycle to print JSON is enabled
2876f2452d8b0655055e362ef6684de8b8e32ae7 Ryan Kang
rbtools/commands/__init__.py
rbtools/commands/tests/test_main.py
Loading...