From patchwork Fri Jul 3 00:14:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 8574 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 5F406C2E69 for ; Fri, 3 Jul 2020 00:14:39 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A03FB60C55; Fri, 3 Jul 2020 02:14:38 +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="tCuwPsUT"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B21A560C55 for ; Fri, 3 Jul 2020 02:14:35 +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 4E50AA2D; Fri, 3 Jul 2020 02:14:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1593735275; bh=waxWcBtbaHpMnw59ICDSApPk1sfE874sepgQYB1a13w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tCuwPsUTFaWuAYO18O9LtFNPZWnp7v3B2tk+woZp/JYXmphCZ9V0bXgpk8hvbGBR7 5ME5Vn24N3mbLVMqysAW4vJLk86ATX213Y1St1xa5ps/sCWOcWTIlJ+S4KW9BKakuS JaXbWZRgcj8UALLSETRPkOUkXz1oNuVoZZ0fhZDk= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Fri, 3 Jul 2020 03:14:17 +0300 Message-Id: <20200703001422.24324-6-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 05/10] utils: raspberrypi: ctt: json_pretty_print: Skip all spaces 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" Skip all white space characters, not just ' '. This makes a difference if the input JSON data is already formatted. Signed-off-by: Laurent Pinchart --- utils/raspberrypi/ctt/ctt_pretty_print_json.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/raspberrypi/ctt/ctt_pretty_print_json.py b/utils/raspberrypi/ctt/ctt_pretty_print_json.py index 3de8c108f01c..dfa99a6d4034 100644 --- a/utils/raspberrypi/ctt/ctt_pretty_print_json.py +++ b/utils/raspberrypi/ctt/ctt_pretty_print_json.py @@ -52,8 +52,6 @@ class JSONPrettyPrinter(object): elif c == ':': self.fout.write(c) self.fout.write(' ') - elif c == ' ': - pass elif c == ',': if not self.state["inarray"][0]: self.fout.write(c) @@ -67,6 +65,8 @@ class JSONPrettyPrinter(object): self.newline() else: self.fout.write(' ') + elif c.isspace(): + pass else: self.fout.write(c) self.state["skipnewline"] = (c == '[')