From patchwork Tue Sep 10 20:48:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 21222 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 7B6C5BF415 for ; Tue, 10 Sep 2024 20:48:35 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4DCA763501; Tue, 10 Sep 2024 22:48:31 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="kychWfHi"; 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 1FE5D634FC for ; Tue, 10 Sep 2024 22:48:22 +0200 (CEST) Received: from pyrite.hamster-moth.ts.net (213-229-8-243.static.upcbusiness.at [213.229.8.243]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C615B1A60; Tue, 10 Sep 2024 22:47:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1726001225; bh=fXcOG7WJk3watae1N/uIAl00DL/AIv97stvFwPFHPM8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kychWfHiQ3lnM/50acbvmG2D32mzvlNV4sLYy0HZtaVRI4G7uixqI3O2x4HBdb3mp +qOy9AwIxiNyzuve8nQYhNwXByznNjEyBel3UbXpDldmEIWgMpl5c+nI5w1QkDA4Qo mbbxv6Pl02EZ1dqQPzBMjIaZuWJNL+j0JCiq+RD8= From: Paul Elder To: libcamera-devel@lists.libcamera.org Cc: Paul Elder , stefan.klug@ideasonboard.com Subject: [PATCH 3/3] py: Add bindings for ControlId enum name Date: Tue, 10 Sep 2024 22:48:12 +0200 Message-Id: <20240910204812.2581246-4-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240910204812.2581246-1-paul.elder@ideasonboard.com> References: <20240910204812.2581246-1-paul.elder@ideasonboard.com> 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" Add python bindings for quering enum value names from a ControlId. Signed-off-by: Paul Elder Reviewed-by: Kieran Bingham --- New in v2 --- src/py/libcamera/py_main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp index ab33f38a8..f6aff5005 100644 --- a/src/py/libcamera/py_main.cpp +++ b/src/py/libcamera/py_main.cpp @@ -404,7 +404,8 @@ PYBIND11_MODULE(_libcamera, m) .def("__repr__", [](const ControlId &self) { return py::str("libcamera.ControlId({}, {}, {})") .format(self.id(), self.name(), self.type()); - }); + }) + .def("enum_name", &ControlId::enumName); pyControlInfo .def_property_readonly("min", [](const ControlInfo &self) {