Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- GT CS6476 Computer Vision
- Script that prints the results a the JSON file downloaded from Bonnie.
- Usage:
- In the terminal window run:
- python print_json.py -f <json_file_path>
- """
- import argparse
- import json
- def main(data):
- with open(data.f) as data_file:
- json_file = json.load(data_file)
- tests = json_file["tests"]
- for t in tests:
- print "----- Test: {} -----".format(t['description'])
- print "Pass / Fail: {}".format(t['output']['passfail'])
- error_msg = t['traceback'].split('Error')
- if len(error_msg) > 0:
- print "Traceback: {}\n".format(t['traceback'].split('Error')[1])
- else:
- print "Traceback: {}\n".format(t['traceback'])
- if __name__ == '__main__':
- parser = argparse.ArgumentParser(description="Prints the contents of a JSON file generated by GT's "
- "CS6476 Autograder")
- parser.add_argument('-f')
- args = parser.parse_args()
- main(args)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement