From patchwork Wed Jan 8 22:29:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 22472 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 CEA6AC326B for ; Wed, 8 Jan 2025 22:30:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F17CB608AB; Wed, 8 Jan 2025 23:30:30 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Qv0OL2bY"; 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 5AEB3608AB for ; Wed, 8 Jan 2025 23:30:29 +0100 (CET) Received: from pyrite.hamster-moth.ts.net (unknown [IPv6:2604:2d80:9e93:ad00:3d82:7e4f:ab9b:8a]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 593D1664; Wed, 8 Jan 2025 23:29:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1736375376; bh=eHdQFCHeA2p/ftSeYp4YJjzQNs2Nf6zIF93WrPn5GIs=; h=From:To:Cc:Subject:Date:From; b=Qv0OL2bY2u8OLwjR8bduGqd3h+Y0OZRYEShQ4n5vfmHioMDdfkZfXAzuG9uS48aX2 PRXGzwmg13isyDrJMwisha+tF1Rn+5ScK/KknqVAwWtIWrsncSjOlWcMZ8tTq78zph cYATBEoFz0FozN8dl+oaaVGao4F8dyN3At4Aiwm0= From: Paul Elder To: libcamera-devel@lists.libcamera.org Cc: Paul Elder Subject: [PATCH] utils: codegen: controls.py: Fix missing direction error message Date: Wed, 8 Jan 2025 16:29:50 -0600 Message-Id: <20250108222950.1317759-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 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 error message for missing direction field prints the direction value (usually 'None') instead of the name of the field 'direction'. Fix this. Fixes: 39fe4ad96803 ("utils: codegen: controls.py: Parse direction information") Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- utils/codegen/controls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/codegen/controls.py b/utils/codegen/controls.py index 602f15b25..e51610481 100644 --- a/utils/codegen/controls.py +++ b/utils/codegen/controls.py @@ -65,7 +65,7 @@ class Control(object): else: direction = self.__data.get('direction') if direction is None: - raise RuntimeError(f'Control `{self.__name}` missing required field `{direction}`') + raise RuntimeError(f'Control `{self.__name}` missing required field `direction`') if direction not in ['in', 'out', 'inout']: raise RuntimeError(f'Control `{self.__name}` direction `{direction}` is invalid; must be one of `in`, `out`, or `inout`') self.__direction = direction