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.

Commits

Files