[Piglit] [PATCH 1/2] piglit-run.py: replace file.write with json_writer calls

Dylan Baker baker.dylan.c at gmail.com
Wed Aug 28 14:24:22 PDT 2013


The current behavior is to write a key, and then dump the status into
it. This reimplements what JSONWireter.write_dict_item() already does,
so just use the write_dict_item() method.

Signed-off-by: Dylan Baker <baker.dylan.c at gmail.com>
---
 piglit-run.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/piglit-run.py b/piglit-run.py
index e8e11b7..33318d4 100755
--- a/piglit-run.py
+++ b/piglit-run.py
@@ -134,10 +134,8 @@ def main():
     json_writer.write_dict_key('options')
     json_writer.open_dict()
     json_writer.write_dict_item('profile', profileFilename)
-    json_writer.write_dict_key('filter')
-    result_file.write(json.dumps(args.include_tests))
-    json_writer.write_dict_key('exclude_filter')
-    result_file.write(json.dumps(args.exclude_tests))
+    json_writer.write_dict_item('filter', args.include_tests)
+    json_writer.write_dict_item('exclude_filter', args.exclude_tests)
     json_writer.close_dict()
 
     json_writer.write_dict_item('name', results.name)
-- 
1.8.1.5



More information about the Piglit mailing list