From patchwork Fri Jul 3 00:14:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 8570 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id AD780BE905 for ; Fri, 3 Jul 2020 00:14:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 316B160C5F; Fri, 3 Jul 2020 02:14:36 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="W7b0ECgw"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 59338609C7 for ; Fri, 3 Jul 2020 02:14:34 +0200 (CEST) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DF230A2D; Fri, 3 Jul 2020 02:14:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1593735274; bh=6cVZuua9BYmUrOOA7o5LCM5TKsuZcuOUdWeLqktF5wU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W7b0ECgwyTU1lYlCMDC+mdnil9XETYtq6XLPkjJKJ4TIPlaHCn8kZg3snO44Vw+uj vgLthYkBENYEPQSWJPPPB0GRwY/C1e8qr58ahXB3YLk1IwrOnL7dI/+O3K2q28Ea+8 cEEcIjQuX8NHwr345emLu8k/UEEF5eCuvd5EWawg= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Fri, 3 Jul 2020 03:14:13 +0300 Message-Id: <20200703001422.24324-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200703001422.24324-1-laurent.pinchart@ideasonboard.com> References: <20200703001422.24324-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 01/10] utils: raspberrypi: ctt: json_pretty_print: Fix printer test X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The ctt_pretty_print_json.py file supports being run standalone to test the code. It however suffers from multiple issues: - The same input file name is hardcoded, and doesn't exist in the repository - The input file name is used instead of JSON data Fix both issues and make the input file selectable on the command line. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- utils/raspberrypi/ctt/ctt_pretty_print_json.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/utils/raspberrypi/ctt/ctt_pretty_print_json.py b/utils/raspberrypi/ctt/ctt_pretty_print_json.py index 73383ea09665..18938c828b4e 100644 --- a/utils/raspberrypi/ctt/ctt_pretty_print_json.py +++ b/utils/raspberrypi/ctt/ctt_pretty_print_json.py @@ -4,6 +4,8 @@ # # ctt_pretty_print_json.py - camera tuning tool JSON formatter +import sys + """ takes a collapsed json file and makes it more readable @@ -72,4 +74,10 @@ def pretty_print_json(str_in, output_filename): if __name__ == '__main__': - pretty_print_json("../ctt/ref_json/final_imx477.json", "pretty.json") + if len(sys.argv) != 2: + print("Usage: %s filename" % sys.argv[0]) + sys.exit(1) + + input_filename = sys.argv[1] + with open(input_filename, "r") as fin: + pretty_print_json(fin.read(), "pretty.json")