[libcamera-devel,v4,7/8] utils: raspberrypi: ctt: Output version 2.0 format tuning files
diff mbox series

Message ID 20220713092159.9014-8-naush@raspberrypi.com
State Superseded
Headers show
Series
  • Replace boost JSON parser with libyaml in Raspberry Pi IPA
Related show

Commit Message

Naushir Patuck July 13, 2022, 9:21 a.m. UTC
Use the tuning file conversion script to output the new tuning file format from
the CTT.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
---
 utils/raspberrypi/ctt/ctt.py | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

Patch
diff mbox series

diff --git a/utils/raspberrypi/ctt/ctt.py b/utils/raspberrypi/ctt/ctt.py
index 15064634c67f..0d91ada15afa 100755
--- a/utils/raspberrypi/ctt/ctt.py
+++ b/utils/raspberrypi/ctt/ctt.py
@@ -15,7 +15,7 @@  from ctt_alsc import *
 from ctt_lux import *
 from ctt_noise import *
 from ctt_geq import *
-from ctt_pretty_print_json import *
+from convert_tuning import convert_v2
 import random
 import json
 import re
@@ -511,13 +511,12 @@  class Camera:
     """
     def write_json(self):
         """
-        Write json dictionary to file
+        Write json dictionary to file using our version 2 format
         """
-        jstring = json.dumps(self.json, sort_keys=False)
-        """
-        make it pretty :)
-        """
-        pretty_print_json(jstring, self.jf)
+        out_json = convert_v2(self.json)
+
+        with open(self.jf, 'w') as f:
+            f.write(out_json)
 
     """
     add a new section to the log file